[Varnish] #1236: requests to same url sometimes hang

Martin Blix Grydeland martin at varnish-software.com
Mon Dec 10 13:27:06 CET 2012

The Varnish min/max thread settings are per thread pool, and the number of
pools defaults to 2. So you were running with a total minimum of 2, which
is why the problem showed only at the 3rd request.

There are a number of runtime parameters that governs thread behavior in
Varnish. Look in the man page and also in that section of the Varnish book.
Note also that while Varnish will scale up the number of threads
automatically when there is consistent thread pressure over time, that
algorithm isn't designed for these low numbers and a request can be starved
in that case.

The default of 1 in the RPMs is just too low to make a running Varnish
instance, and I believe this has been changed in recent RPMs (but your
configuration files may stuck form an earlier release?) You should
configure more like a minimum of 100. Varnish' threads are cheap, and if
they are not ever being used they hardly take up any resources either.

Martin Blix Grydeland

On Mon, Dec 10, 2012 at 12:59 PM, Reinhard Vicinus <r.vicinus at metaways.de>wrote:

> Hi,
> yes, we are running with only 1 worker thread as minimum (-w 1,1000,120).
> After changing this to 2 worker threads as minimum (-w 2,1000,120) i wasn't
> able to reproduce the problem anymore. So it seams that your prediction was
> right. But i have difficulties understanding why the minimum number of
> threads caused that behavior, because i would expect that already the
> second request would hang and not the third.
> The only explanation i have is, that after the initial request he creates
> a second thread for the second request and if i'm fast enough the third
> request is send as the second request hasn't finished, yet. Then varnish
> don't want to create a third thread for the third request and instead
> queues the third request in the queue of the first thread for execution
> afterwards. Am I correct or is there another cause for this behavior? Also
> if i'm right is there somewhere a description which describe how requests
> are queued up?
> Thanks in advance
> Reinhard
> On 10/12/12 12:17, Varnish wrote:
>> #1236: requests to same url sometimes hang
>> ----------------------+-------**-------------
>>   Reporter:  reinhard  |       Owner:
>>       Type:  defect    |      Status:  new
>>   Priority:  normal    |   Milestone:
>> Component:  varnishd  |     Version:  3.0.3
>>   Severity:  normal    |  Resolution:
>>   Keywords:            |
>> ----------------------+-------**-------------
>> Comment (by martin):
>>   Hi,
>>   Could you verify the minimum number of threads you have configured? This
>>   sounds like you are running with a only 1 worker thread, and you are
>> being
>>   hit by Varnish not wanting to create new threads unless there is a real
>>   workload present needing it. Try increasing the minimum number of
>> threads.
>>   Reagrds,
>>   Martin Blix Grydeland
> --
> Reinhard Vicinus
> Metaways Infosystems GmbH
> Pickhuben 2, D-20457 Hamburg
> E-Mail: r.vicinus at metaways.de
> Web:    http://www.metaways.de
> Tel:    +49 (0)40 317031-524
> Fax:    +49 (0)40 317031-10
> Metaways Infosystems GmbH - Sitz: D-22967 Tremsbüttel
> Handelsregister: Amtsgericht Lübeck HRB 4508 AH
> Geschäftsführung: Hermann Thaele, Lüder-H. Thaele

<http://varnish-software.com>*Martin Blix Grydeland*
Senior Developer | Varnish Software AS
Cell: +47 21 98 92 60
We Make Websites Fly!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-bugs/attachments/20121210/c83e81df/attachment.html>

More information about the varnish-bugs mailing list