Skip to content

Instantly share code, notes, and snippets.

@avshabanov
Created February 5, 2017 07:33
Show Gist options
  • Save avshabanov/90d00233ff489258a855b30dda1d0d66 to your computer and use it in GitHub Desktop.
Save avshabanov/90d00233ff489258a855b30dda1d0d66 to your computer and use it in GitHub Desktop.
Brikar RPCv2 vs RPCv1

Preparations

echo '{"userIds": [10, 11, 12, 13, 14]}' > /tmp/queryUsersRequest.txt

Timings

The results of:

ab -p /tmp/queryUsersRequest.txt -T application/json -c 10 -n 10000 http://10.0.1.5:8080/api/rpc/UserService/queryUsers

are:

Document Path:          /api/rpc/UserService/queryUsers
Document Length:        210 bytes

Concurrency Level:      10
Time taken for tests:   7.480 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      2870000 bytes
Total body sent:        1980000
HTML transferred:       2100000 bytes
Requests per second:    1336.97 [#/sec] (mean)
Time per request:       7.480 [ms] (mean)
Time per request:       0.748 [ms] (mean, across all concurrent requests)
Transfer rate:          374.72 [Kbytes/sec] received
                        258.52 kb/s sent
                        633.23 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       5
Processing:     1    7   6.3      4     170
Waiting:        1    7   6.2      4     170
Total:          2    7   6.3      4     171

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      5
  75%      8
  80%     13
  90%     15
  95%     18
  98%     26
  99%     30
 100%    171 (longest request)

The results of:

ab -p /tmp/queryUsersRequest.txt -T application/json -c 10 -n 10000 http://10.0.1.5:8080/rpc/api/UserService/queryUsers

are:

Document Path:          /rpc/api/UserService/queryUsers
Document Length:        210 bytes

Concurrency Level:      10
Time taken for tests:   2.764 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      2870000 bytes
Total body sent:        1980000
HTML transferred:       2100000 bytes
Requests per second:    3617.67 [#/sec] (mean)
Time per request:       2.764 [ms] (mean)
Time per request:       0.276 [ms] (mean, across all concurrent requests)
Transfer rate:          1013.94 [Kbytes/sec] received
                        699.51 kb/s sent
                        1713.45 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       6
Processing:     1    2   2.6      2      18
Waiting:        1    2   2.6      2      18
Total:          1    3   2.7      2      19

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      2
  90%      3
  95%     12
  98%     13
  99%     13
 100%     19 (longest request)
@avshabanov
Copy link
Author

Subsequent runs are in sync w/ RPCv1, with almost the same 90-99 percentiles and marginally higher 100 percentile (26ms vs 15-19ms).

@avshabanov
Copy link
Author

With connection reuse:

Document Path:          /api/rpc/UserService/queryUsers
Document Length:        210 bytes

Concurrency Level:      10
Time taken for tests:   5.479 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Keep-Alive requests:    0
Total transferred:      2870000 bytes
Total body sent:        2220000
HTML transferred:       2100000 bytes
Requests per second:    1825.02 [#/sec] (mean)
Time per request:       5.479 [ms] (mean)
Time per request:       0.548 [ms] (mean, across all concurrent requests)
Transfer rate:          511.50 [Kbytes/sec] received
                        395.66 kb/s sent
                        907.16 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       4
Processing:     1    5   3.7      4      28
Waiting:        1    5   3.7      4      28
Total:          2    5   3.7      4      28

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      4
  80%      5
  90%     14
  95%     15
  98%     15
  99%     15
 100%     28 (longest request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment