3 ms·
http isn't particularly my thing, so if i'm wrong, please correct me! however, i was of the impression that a keep-alive session wouldn't return to the accept s
by foxhill 9y ago
http isn't particularly my thing, so if i'm wrong, please correct me! however, i was of the impression that a keep-alive session wouldn't return to the accept stage - the socket is still open, surely?
- majke 9y agoCorrect. The point is the worker may be relatively idle when it accepts() plenty of connections and the load only happens after that. When the requests on the connections start to flow. You can imagine a situation when a single worker gets most of the traffic and runs out of cpu (while other workers idle).
- Tepix 9y agoOnce solution would be that the workers pass each other the socket descriptor (using sendmsg()) once they notice that there are idle brethren and they have a lot of work in the queue.
- funnelsgun 9y agoCould that cause a race condition with multiple processes using epoll on the same file descriptors?
- barrkel 9y agoSo I think the magic piece of information missing from the article is that workers can have multiple open per-client sockets "on the go"; so if one worker gets all the client sockets, then you're not getting parallelism.