capistrano / capistrano/sshkit

Issue: Parallel executor performance is mostly linear

Open
#326 20 comments 0 reactions 0 assignees View on GitHub
bug?
Dominant language
Ruby
Stars
1.2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

We use capistrano to deploy on several hundred servers at once, and we noticed capistrano's performance was heavily tied to the number of servers.

To prove it I ran the following benchmark:

``` ruby
require 'benchmark'
require 'csv'
task :bench do
servers = roles(:borg).to_a
timings = {}

if ENV['PREWARM']
on servers do
execute :echo, 'pong > /dev/null'
end
end

[1, 10, 50, 100].each do |count|
timings[count] = Benchmark.measure do
on servers.pop(count) do
execute :echo, 'pong > /dev/null'
end
end
end

res = [%w(count user system real)]
timings.each do |count, timing|
res << [count, timing.utime, timing.stime, timing.real]
end
puts res.map(&:to_csv).join
end
```

Here are the results: [Spreadsheet](https://docs.google.com/spreadsheets/d/1iyJC3a2AAeqnWjH2uGKp2ZClEsVSxN2QB0D5v85LUBc/edit?usp=sharing)

capture d ecran 2016-02-02 a 18 41 29

The first graph is with "cold" connections, meaning it's connection establishment plus the command execution. In the second graph, all the connections were pre established before the benchmark.

I'm still investigating to figure out where exactly the bottleneck (or bottlenecks) exactly is. I know the GIL is not for nothing, but capistrano / SSHKit being IO heavy, I think there is other reasons.

cc @kirs as well as @csfrancis

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.