Thread pools

Mark Moseley moseleymark at
Tue Aug 18 02:55:39 CEST 2009

I've seen various things in the wiki and threads on this list talking
about thread pools. In general, the advice is typically conservative,
i.e. don't use more than the default 2 thread pools unless you have
to. I've also seen the occasional comment suggesting one run as many
thread pools as there are cores/cpus.

Is the "conservative" still generally correct? Is there any serious
penalty for running ${NUM_OF_CORES_OR_NUM_OF_CPUS} thread pools (but
not exceeding the # of CPUs/cores)? Or is there a serious penalty for
running *fewer* than ${NUM_OF_CORES_OR_NUM_OF_CPUS} thread pools?
Given something like a (quite) busy quad-core dual processor box, can
I afford to do 4 thread pools (or even 6 or 8)? So far I've been just
doing the default # of thread pools (with min. of 500 threads in

Also, the wiki mentions that it's mainly appropriate when you run into
locks tying things up. Is that mainly a case of high LRU turnover or
are there other scenarios where locking is an issue? What are the
symptoms of locking becoming an issue with the current configuration
and what fields in varnishstat should I be looking at?

In my case, LRU turnover is non-trivial. As mentioned on another
ticket, we're using varnish in a web hosting environment, so the hit
rate is ~25-30%, which for this environment is utterly fantastic --
and so far we've been totally impressed with it.

Sorry for the mass of questions, I'm just looking to eke out every
possible iota of performance. We've mainly got Dell Poweredge 850s and
1950s running varnish. The 850s are straightforward enough, but I
worry about wasting any CPU% on those 8 core 1950s -- but I also don't
want to introduce a whole other set of problems by using too many
thread pools.


More information about the varnish-misc mailing list