Connections on the varnishbox

Dag-Erling Smørgrav des at linpro.no
Thu Oct 25 15:13:51 CEST 2007


Eivind Bengtsson <ebe at dmi.dk> writes:
> Dag-Erling Smørgrav wrote:
> > Eivind Bengtsson <ebe at dmi.dk> writes:
> > > How many thread pools do I have ? (default?)
> > 1
> Can I just raise the number of thread pools ? - what is the penalty ?

>From varnishd(1):

     thread_pools
           The number of worker thread pools.  Higher values reduce lock con-
           tention but increase pressure on the scheduler.  Note that a
           decrease of this parameter will only take effect after a restart.

           The default is 1.

Note that thread_pool_max is the total number of threads, not the
number of threads per pool.

One thing the man page doesn't mention is that connections are
assigned to pools by computing (fd % thread_pools), so increasing the
number of pools will also increase the likelihood that a connection
will remain on the overflow queue even if there are threads available
in other pools.  I don't know where the cutoff is, but it's likely to
be at or below sqrt(thread_pool_max).

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no



More information about the varnish-misc mailing list