{"id":21970820,"url":"https://github.com/kingluo/etcd-benchmark","last_synced_at":"2026-05-04T14:35:01.426Z","repository":{"id":162839848,"uuid":"637320885","full_name":"kingluo/etcd-benchmark","owner":"kingluo","description":"etcd http/grpc performance testing","archived":false,"fork":false,"pushed_at":"2023-05-16T05:37:27.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-28T02:27:26.394Z","etag":null,"topics":["etcd","etcdv3","grpc","http"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingluo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-07T07:29:08.000Z","updated_at":"2023-05-18T14:17:48.000Z","dependencies_parsed_at":"2023-05-29T01:15:31.009Z","dependency_job_id":null,"html_url":"https://github.com/kingluo/etcd-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Fetcd-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Fetcd-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Fetcd-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingluo%2Fetcd-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingluo","download_url":"https://codeload.github.com/kingluo/etcd-benchmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245031362,"owners_count":20549913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["etcd","etcdv3","grpc","http"],"created_at":"2024-11-29T14:43:12.960Z","updated_at":"2026-05-04T14:34:56.406Z","avatar_url":"https://github.com/kingluo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# etcd-benchmark\netcd http/grpc performance testing\n\n## background\n\nWhat is the difference in the efficiency of accessing etcd with http and grpc respectively?\n\nWe use below client programs to do the test:\n1. http [go-http](https://pkg.go.dev/net/http#Client), access etcd grpc gateway, http keepalive enabled\n2. grpc [go-etcd](https://pkg.go.dev/go.etcd.io/etcd/client/v3)\n\n## test\n\n```bash\n# http put\ngo run http.go -c 10 -n 8000 -host http://httpbin.local:2379 -put\n\n# grpc put\ngo run grpc.go -c 10 -n 8000 -host http://httpbin.local:2379 -put\n\n# you could watch the connections to etcd\nwatch -n 3 \"ss -tnp '( dport = :2379 )' | sort -k6\"\n\n# http watch\n# in terminal-1\ngo run http.go -c 10 -n 8000 -host http://httpbin.local:2379 -watch\n# in terminal-2, raise traffic to watch\ngo run grpc.go -c 10 -n 8000 -host http://httpbin.local:2379 -put\n\n# grpc watch\n# in terminal-1\ngo run grpc.go -c 10 -n 8000 -host http://httpbin.local:2379 -watch\n# in terminal-2, raise traffic to watch\ngo run grpc.go -c 10 -n 8000 -host http://httpbin.local:2379 -put\n```\n\n![etcd benchmark](etcd-benchmark.svg)\n\n* watch performance is almost the same,\nbecause http uses only one tcp connection and chunked streaming for receiving watch events.\n* put performance, grpc is about `13%` better than http, and the cpu of etcd server is smaller than grpc client.\n  * http uses multiple tcp connections, because http/1.1 cannot multiplex requests\n  * http has bigger size of packets than grpc (http/2)\n  * etcd uses grpc-gateway to bridge the traffic between http and grpc internally\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingluo%2Fetcd-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingluo%2Fetcd-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingluo%2Fetcd-benchmark/lists"}