|
|
|
|
|
by kqueue
5345 days ago
|
|
request rate is not influenced much by the polling mechanism (epoll/kqueue/poll/select) when all you're doing is listening to one fd and processing new ones then closing then immediately. These multiplexers matter when you are working on lots of file descriptors. It matters because select will have to iterate over all the file descriptors you passed to it, while kqueue for example have knotes registered to it when it wakes up and won't need to iterate over everything, but just the knotes it got. Not to mention the data copying from userland to the kernel in case of select/poll. Back to the request rate limitations, the limitation is mainly coming from the # of system calls you can execute in a sec (accept() in this case) which is heavily influenced by the context switches. Looking at the application CPU gives you a very good idea of what your bottleneck is. If your CPU is 100% then it's clear your application is hitting the limit, but if the application CPU is at 30% and you cannot process more requests / sec then you've hit the system limit here. |
|
Hellepoll uses 'epoll' which is the Linux equivalent of kqueue. Kqueue is said to be marginally faster still, and I look forward to Hellepoll using kqueue when running on FreeBSD. Epoll/kqueue absolutely affect accept rate incidentally, so its an exercise to the reader to work out why ;)
Hellepoll does use the fanciest features of epoll like 'edge triggering' which is perhaps one of the things making it nudge ahead of Java's NIO-based webservers (as NIO is lowest-common-denominator and lacks ET).
Finally, Hellepoll is really writing meaningful bytes, and it even flushes them in keep-alive connections (obviously; think how it would ever work otherwise?).
So I think, on balance, Hellepoll is the real thing and not just measuring how quickly a big backlog on a listening socket can fill up ;)
On Linux, I've found the new 'perf timechart' a lot of fun.