[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#3665) Multi-Listener Thread Support



Howard Chu wrote:

Overall I'm not totally convinced that this is the right place to be dividing the labor. It would make more sense to me to keep the single listener, and hand off each triggered event to the thread pool, so that reading and parsing is

The reason you don't want to do that is the context switch overhead to get the operation from
one thread to another. For optimal performance on an SMP system the same thread should handle
all processing through from reading the operation off the socket to sending the response back
(and that thread should stay on the same CPU because its cache will be hot with that
connection's context).


I'm not sure that it matters so much to optimize connection accept and setup :
a new TCP connection is a reasonably heavyweight event anyway, and
IME the cases that are performance-critical are all where the client is some
server app that nails open a pool of persistent connections anyway.