rust-http icon indicating copy to clipboard operation
rust-http copied to clipboard

Poor performance when HTTP keep-alive is disabled

Open bnoordhuis opened this issue 11 years ago • 0 comments

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.

bnoordhuis avatar Oct 16 '14 01:10 bnoordhuis