state-threads
state-threads copied to clipboard
Fork of http://state-threads.sourceforge.net/
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...
This causes CLOSE_WAIT-state sockets to linger. This fix cures it: @@ -142,7 +142,7 @@ static __thread struct _st_epolldata { #define _ST_EPOLL_EXCEP_CNT(fd) (_st_epoll_data->fd_data[fd].ex_ref_cnt) #define _ST_EPOLL_REVENTS(fd) (_st_epoll_data->fd_data[fd].revents) -#define _ST_EPOLL_READ_BIT(fd) (_ST_EPOLL_READ_CNT(fd) ? EPOLLIN...