Skip to content

Instantly share code, notes, and snippets.

@orend
Created August 30, 2011 14:00
Show Gist options
  • Save orend/1180957 to your computer and use it in GitHub Desktop.
Save orend/1180957 to your computer and use it in GitHub Desktop.
synchrony driver benchmarking
So using the synchrony driver I get the following with concurrency level of 1:
Server Software: thin
Server Hostname: 0.0.0.0
Server Port: 5000
Document Path: /vsync/sync
Document Length: 3002 bytes
Concurrency Level: 1
Time taken for tests: 15.843 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 1000
Total transferred: 3151000 bytes
Total POSTed: 379379
HTML transferred: 3002000 bytes
Requests per second: 63.12 [#/sec] (mean)
Time per request: 15.843 [ms] (mean)
Time per request: 15.843 [ms] (mean, across all concurrent requests)
Transfer rate: 194.22 [Kbytes/sec] received
23.38 kb/s sent
217.61 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 9 16 9.1 11 41
Waiting: 9 16 9.1 11 41
Total: 9 16 9.1 11 41
Percentage of the requests served within a certain time (ms)
50% 11
66% 12
75% 13
80% 31
90% 32
95% 34
98% 35
99% 37
100% 41 (longest request)
Increasing concurrency doesn't seem to improve throughput:
Server Software: thin
Server Hostname: 0.0.0.0
Server Port: 5000
Document Path: /vsync/sync
Document Length: 3733 bytes
Concurrency Level: 2
Time taken for tests: 15.333 seconds
Complete requests: 1000
Failed requests: 999
(Connect: 0, Receive: 0, Length: 999, Exceptions: 0)
Write errors: 0
Keep-Alive requests: 1000
Total transferred: 3151731 bytes
Total POSTed: 379758
HTML transferred: 3002731 bytes
Requests per second: 65.22 [#/sec] (mean)
Time per request: 30.666 [ms] (mean)
Time per request: 15.333 [ms] (mean, across all concurrent requests)
Transfer rate: 200.74 [Kbytes/sec] received
24.19 kb/s sent
224.92 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 6 15 9.0 11 44
Waiting: 6 15 9.0 11 44
Total: 6 15 9.0 11 44
Percentage of the requests served within a certain time (ms)
50% 11
66% 11
75% 12
80% 31
90% 32
95% 33
98% 35
99% 37
100% 44 (longest request)
Compare that with the hiredis connection:
Server Software: thin
Server Hostname: 0.0.0.0
Server Port: 5000
Document Path: /vsync/sync
Document Length: 3002 bytes
Concurrency Level: 1
Time taken for tests: 7.830 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 1000
Total transferred: 3151000 bytes
Total POSTed: 379379
HTML transferred: 3002000 bytes
Requests per second: 127.71 [#/sec] (mean)
Time per request: 7.830 [ms] (mean)
Time per request: 7.830 [ms] (mean, across all concurrent requests)
Transfer rate: 393.00 [Kbytes/sec] received
47.32 kb/s sent
440.31 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 6 8 5.0 7 44
Waiting: 6 8 5.0 7 44
Total: 6 8 5.0 7 44
Percentage of the requests served within a certain time (ms)
50% 7
66% 7
75% 7
80% 7
90% 8
95% 9
98% 31
99% 32
100% 44 (longest request)
With hiredis I'm not benefiting from increasing concurrency but that's expected as hiredis is blocking:
Server Software: thin
Server Hostname: 0.0.0.0
Server Port: 5000
Document Path: /vsync/sync
Document Length: 3002 bytes
Concurrency Level: 2
Time taken for tests: 7.950 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 1000
Total transferred: 3151000 bytes
Total POSTed: 379758
HTML transferred: 3002000 bytes
Requests per second: 125.79 [#/sec] (mean)
Time per request: 15.899 [ms] (mean)
Time per request: 7.950 [ms] (mean, across all concurrent requests)
Transfer rate: 387.08 [Kbytes/sec] received
46.65 kb/s sent
433.73 kb/s total
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 6 16 8.6 14 82
Waiting: 6 16 8.6 14 82
Total: 6 16 8.6 14 82
Percentage of the requests served within a certain time (ms)
50% 14
66% 14
75% 16
80% 19
90% 22
95% 38
98% 44
99% 45
100% 82 (longest request)
I switch between the 2 connections by alternating between these 2 code blocks in the Gemfile:
# use these linse for the synchrony driver
gem "hiredis", "~> 0.3.1"
gem 'em-synchrony'
gem "redis", "~> 2.2.0", :require => ["redis/connection/synchrony", "redis"]
# use these lines for the hiredis driver
gem "hiredis", "~> 0.3.1"
gem "redis", "~> 2.2.0" , :require => ["redis/connection/hiredis", "redis"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment