My development machine is a MacBook (which of course has kqueue). However, in production we're running Linux (which of course uses epoll). Obviously, to know the performance characteristics of my code I need to run it using epol开发者_运维百科l. That said, is performance that I see under kqueue a decent approximation of what I'll see with epoll? Or are there any situations where performance may be significantly different? For the most part, it seems that kqueue and epoll are pretty much similar in terms of performance, but I haven't really done very thorough testing.
If it makes a difference, I'm using tornado in Python.
kqueue outperforms epoll according to Berkeley University mainly because epoll does not support multiple interest updates in a single system call, while kqueue can do that using kevent().
There is a technical paper on the differences between the 2 and performance comparison also.
http://www.eecs.berkeley.edu/~sangjin/2012/12/21/epoll-vs-kqueue.html
http://www.daemonforums.org/showthread.php?t=2124
精彩评论