3 ms·
What is memory usage per connection? How much unnecessary data copying is going on? What is latency? What happens under the real load of, say, a thousand concu
by dschiptsov 14y ago
What is memory usage per connection? How much unnecessary data copying is going on? What is latency?
What happens under the real load of, say, a thousand concurrent TCP connections together with few thousand of back-end/other data-sources pending calls?
What will happen to memory usage and latency when simple setup above will serve simplest remote requests (which means stalled connections, re-tranmitions, etc) for 8 hours? 24 hours?
- shenedu 14y agohttp-kit needs a few kilobytes of memory (buffer for parsing HTTP request, maintain state, etc) for a connection. The thread model used by http-kit: a dedicated thread(server-loop), only doing events IO and parsing, when done, queued the request for a thread poll to take it, thread pool compute the response, queue it for the server-loop thread to write it back to client. Since epoll and kqueue's readiness selection is O(1), idle connections does not hurt latency at all.
- ptaoussanis 14y agoMemory use is a few KB per connection. Latency is good (same ballpark as nginx in my tests with most workloads). Can't comment on data copying. This is a new server so obviously nowhere near battle-tested yet, but anecdotally: Both the author and I are running/testing small/medium sized deployments that are performing quite reliably. It's much too soon to say anything conclusively, but I would say the early data I've seen is promising.