Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using Capistrano to deploy web applications from Amazon EC2 instances to our staging and production servers, but finding file transfer performance is very slow compared to a direct invocation of the scp command:

# US-East to London
SCP: 11.2 MB/s
Capistrano: 0.7 MB/s
    (16x slower)

The file being transfered is a single 376MB tarball, so latency shouldn't be a big issue (compared with many small files).

The Amazon EC2 instance is in the US East region, while our staging and production servers are in London. Obviously we should expect an improvement if we migrate to the Amazon EU West (Ireland) region, and this is being planned, however initial tests show Capistrano SSH speed is still a fraction of what we can get with raw SCP.

# EU-West to London
SCP: 20.1 MB/s
Capistrano: 2.8 MB/s
    (7x slower)

I assume latency is the main variable. By moving to a closer location, we reduce the ratio of SCP to Capistrano speeds, but it's still a significant difference.

All tests done with Capistrano 2.15, Ruby 1.9 on Debian Wheezy. We usually use a VPN connection, but I removed this for all the above tests. I have also tried an alternative destination server near London on a completely different network, with similar results.

My questions then: has anyone else experienced this, and is there a way to overcome it (ssh options perhaps)? Can Capistrano be forced to invoke the scp command for this step?

I have considered upgrading to Capistrano 3, however it doesn't seem to support our workflow, set :deploy_via, :copy (application code checked out and tested on the build server, then use Capistrano to copy the whole package, including dependencies, to the deployment server).

If this can't be resolved in Capistrano 2, I'm open to alternatives, not just Capistrano 3.

[Edit: I forgot to include my Capistrano config; all the tests above are done with a very pared down script as follows]

deploy.rb

require 'capistrano/ext/multistage'
require 'rubygems'
require 'railsless-deploy'

set :stages, %w(dev)
set :default_stage, "dev"
set :application, "Deploy Test"

set :scm, :none
set :repository, ".."
set :deploy_via, :copy
set :deploy_to, '/tmp/deploy-test'

ssh_options[:paranoid] = false
ssh_options[:user_known_hosts_file] = '/dev/null'

set :user, 'lars'
set :group, 'lars'
set :use_sudo, false

deploy/dev.rb

server '#####.net', :app, :web, :primary => true
ssh_options[:keys] = '/home/lars/.ssh/#####_rsa'
ssh_options[:user] = 'lars'
ssh_options[:port] = '#####'
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com?utm_source=stackoverflow.com&amp;utm_medium=site-ui&amp;utm_campaign=footerlink\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a>                   with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.11.24.2042\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Server Fault works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </nosc"], "copyright__copyright__copyright": ["\n\nssh_options[:paranoid] = false\nssh_options[:user_known_hosts_file] = '/dev/null'\n\nset :user, 'lars'\nset :group, 'lars'\nset :use_sudo, false\n\ndeploy/dev.rb\n\nserver '#####.net', :app, :web, :primary => true\nssh_options[:keys] = '/home/lars/.ssh/#####_rsa'\nssh_options[:user] = 'lars'\nssh_options[:port] = '#####'\nshare|improve this question\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nBrowse other questions tagged or ask your own question."]}