Tomdee

23Feb/150

Simple benchmarking of etcd read and write performance

There's surprisingly little information on the web about the performance of CoreOS's distributed data store etcd. It's reasonable to assume that writes are slow (because they need to be replicated) and reads should be fast (because they can just come from RAM). But everything is being transported over HTTP and needs to be JSON encoded. I know that etcd hasn't been optimized for performance (yet) but it would be great to know what sort of ballpark performance is possible.

I ran a few simple tests against etcd version 2.0.0, on a single node "cluster" running on an Ubuntu 14.04 VM running on a slow Dell laptop. This isn't any kind of reliable benchmark - I'm just trying to get a ballpark estimate.

I started testing with boom (the python version) but it was way too slow, so I switched to ab.

Results

I tested 10000 requests, with 10 concurrent workers. I also turned on HTTP keepalives.

  • Read Performance - 6758 req/sec
  • Write Performance - 1388 writes/sec (but about 20% of the requests failed)

Not too shabby but the numbers should be taken with a large pinch of salt. I'm testing against localhost and only reading/writing a tiny amount of data. The write number is pretty meaningless given that I have a single node in my cluster and a lot of the requests failed (though I tried a single concurrent connection and got 0 failures and roughly 350 writes/sec - still pretty respectable)

Read details

ab -k -c 10 -n 10000 http://127.0.0.1:4001/v2/keys/key
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software:
Server Hostname: 127.0.0.1
Server Port: 4001

Document Path: /v2/keys/key
Document Length: 93 bytes

Concurrency Level: 10
Time taken for tests: 1.480 seconds
Complete requests: 10000
Failed requests: 0
Keep-Alive requests: 10000
Total transferred: 3220000 bytes
HTML transferred: 930000 bytes
Requests per second: 6758.10 [#/sec] (mean)
Time per request: 1.480 [ms] (mean)
Time per request: 0.148 [ms] (mean, across all concurrent requests)
Transfer rate: 2125.11 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 0 1 1.0 1 13
Waiting: 0 1 1.0 1 13
Total: 0 1 1.0 1 13

Percentage of the requests served within a certain time (ms)
50% 1
66% 2
75% 2
80% 2
90% 2
95% 3
98% 4
99% 5
100% 13 (longest request)

Write details

ab -k -u data -c 10 -n 10000 http://127.0.0.1:4001/v2/keys/key
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software:
Server Hostname: 127.0.0.1
Server Port: 4001

Document Path: /v2/keys/key
Document Length: 169 bytes

Concurrency Level: 10
Time taken for tests: 7.202 seconds
Complete requests: 10000
Failed requests: 2035
(Connect: 0, Receive: 0, Length: 2035, Exceptions: 0)
Keep-Alive requests: 10000
Total transferred: 4000173 bytes
Total body sent: 1650000
HTML transferred: 1698138 bytes
Requests per second: 1388.59 [#/sec] (mean)
Time per request: 7.202 [ms] (mean)
Time per request: 0.720 [ms] (mean, across all concurrent requests)
Transfer rate: 542.44 [Kbytes/sec] received
223.75 kb/s sent
766.19 kb/s total

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 2
Processing: 3 7 1.9 7 30
Waiting: 3 7 1.9 7 30
Total: 3 7 1.9 7 32

Percentage of the requests served within a certain time (ms)
50% 7
66% 7
75% 8
80% 8
90% 9
95% 10
98% 12
99% 14
100% 32 (longest request)

Tagged as: , No Comments