How could I setup a nice indice on cap:deploy
?
I want the remote server to nice the cp
commands like so:
nice -n 19 cp ...
How could I setup a nice indice on cap:deploy
?
I want the remote server to nice the cp
commands like so:
nice -n 19 cp ...
Not sure about cp. Don't you use an SCM?
I tried with my setup (I use subversion) and this seems to work. In deploy.rb, add:
set :scm_command, "nice -19 svn"
It seems somewhat more difficult if you don't use an SCM, you'll have to overload checkout() in deploy/scm/none.rb.
For those who wants to nice assets:precomile
task, the very time consuming task, following worked for me.
namespace :deploy do
task :map_bins_to_nice do
SSHKit.config.command_map.prefix[:rake]&.unshift('nice -n 19')
end
end
Capistrano::DSL.stages.each do |stage|
after stage, 'deploy:map_bins_to_nice'
end
Note that this makes every rake
task to be niced. E.g. rake db:migrate
.
This was originally taken from following post (Japanese). http://d.hatena.ne.jp/nekonokataomoi/20140819/1408443332