Physical machines

GCE n1-highcpu-2 machine type

  • 1x dedicated local SSD mounted under /var/lib/etcd
  • 1x dedicated slow disk for the OS
  • 1.8 GB memory
  • 2x CPUs

etcd Cluster

3 etcd 2.2.0-rc members, each runs on a single machine.

Detailed versions:

  1. etcd Version: 2.2.0-alpha.1+git
  2. Git SHA: 59a5a7e
  3. Go Version: go1.4.2
  4. Go OS/Arch: linux/amd64

Also, we use 3 etcd 2.1.0 alpha-stage members to form cluster to get base performance. etcd’s commit head is at c7146bd5, which is the same as the one that we use in etcd 2.1 benchmark.

Testing

Bootstrap another machine and use the boom HTTP benchmark tool to send requests to each etcd member. Check the benchmark hacking guide for detailed instructions.

Performance

reading one single key

key size in bytesnumber of clientstarget etcd serverread QPS90th Percentile Latency (ms)
641leader only2804 (-5%)0.4 (+0%)
6464leader only17816 (+0%)5.7 (-6%)
64256leader only18667 (-6%)20.4 (+2%)
2561leader only2181 (-15%)0.5 (+25%)
25664leader only17435 (-7%)6.0 (+9%)
256256leader only18180 (-8%)21.3 (+3%)
6464all servers46965 (-4%)2.1 (+0%)
64256all servers55286 (-6%)7.4 (+6%)
25664all servers46603 (-6%)2.1 (+5%)
256256all servers55291 (-6%)7.3 (+4%)

writing one single key

key size in bytesnumber of clientstarget etcd serverwrite QPS90th Percentile Latency (ms)
641leader only76 (+22%)19.4 (-15%)
6464leader only2461 (+45%)31.8 (-32%)
64256leader only4275 (+1%)69.6 (-10%)
2561leader only64 (+20%)16.7 (-30%)
25664leader only2385 (+30%)31.5 (-19%)
256256leader only4353 (-3%)74.0 (+9%)
6464all servers2005 (+81%)49.8 (-55%)
64256all servers4868 (+35%)81.5 (-40%)
25664all servers1925 (+72%)47.7 (-59%)
256256all servers4975 (+36%)70.3 (-36%)

performance changes explanation

  • read QPS in most scenarios is decreased by 5~8%. The reason is that etcd records store metrics for each store operation. The metrics is important for monitoring and debugging, so this is acceptable.

  • write QPS to leader is increased by 20~30%. This is because we decouple raft main loop and entry apply loop, which avoids them blocking each other.

  • write QPS to all servers is increased by 30~80% because follower could receive latest commit index earlier and commit proposals faster.