Skip to content
This repository has been archived by the owner on Oct 31, 2020. It is now read-only.

a performance issue for epoll #5

Open
lihuiba opened this issue Apr 23, 2017 · 0 comments
Open

a performance issue for epoll #5

lihuiba opened this issue Apr 23, 2017 · 0 comments

Comments

@lihuiba
Copy link

lihuiba commented Apr 23, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant