Connections on the varnishbox

Dag-Erling Smørgrav des at
Fri Oct 26 13:39:50 CEST 2007

"Poul-Henning Kamp" <phk at> writes:
> In retrospect, I am not convinced that idea/implementation of
> multiple thread pools is sufficiently sound.  Its one area that
> we will have to impove somehow.
> Under no circumstances should more than a few pools (< 5) be created.

I wonder...

Why do we have a complex setup with pools, workers within pools etc.?
If we just used the socket descriptor as a direct index into an array
of workers, no locking would be necessary since the descriptor itself
would act as a semaphore.  Since the kernel always picks the lowest-
numbered descriptor available, we would always reuse the most recently
used thread, or almost always; using a socket descriptor for a backend
requests would lock out the corresponding worker for the duration of
the request, but that should not be an issue as long as the cache hit
ratio is reasonably high.

Dag-Erling Smørgrav
Senior Software Developer
Linpro AS -

More information about the varnish-misc mailing list