state-threads icon indicating copy to clipboard operation
state-threads copied to clipboard

a performance issue for epoll

Open lihuiba opened this issue 8 years ago • 0 comments

I came across a performance issue in epoll mode, when there were thousands concurrent connections. Profiling shows that _st_epoll_dispatch() consumed a lot of CPU.

After reviewing the function, I think I've found the reason: there's a loop that enumerates ALL threads in the I/O queue.

    for (q = _ST_IOQ.next; q != &_ST_IOQ; q = q->next) {

As I'm using one thread per connection model, I believe this loop make epoll mode degraded effectively to select mode.

lihuiba avatar Apr 23 '17 06:04 lihuiba