rust-http
rust-http copied to clipboard
Poor performance when HTTP keep-alive is disabled
I observe that throughput for a simple 'Hello, world' server drops by about 10x when the client does not use or support HTTP keep-alive. My 8-core i7 manages about ~28k req/s with keep-alive and ~2.4k req/s without.
I expected some TCP setup/teardown overhead but, according to perf record, most CPU time can be traced back to the spawn() call in src/http/server/mod.rs. I see expensive system calls to clone(), mmap(), mprotect(), and so on, all originating from imp::thread::create() from the standard library. A thread pool would probably help alleviate that.