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.<div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>Regards,</div><div>Martin Blix Grydeland<br><br><div class="gmail_quote">On Mon, Dec 10, 2012 at 12:59 PM, Reinhard Vicinus <span dir="ltr"><<a href="mailto:r.vicinus@metaways.de" target="_blank">r.vicinus@metaways.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
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.<br>

<br>
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?<br>

<br>
Thanks in advance<br>
Reinhard<div class="im"><br>
<br>
<br>
On 10/12/12 12:17, Varnish wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
#1236: requests to same url sometimes hang<br>
----------------------+-------<u></u>-------------<br>
  Reporter:  reinhard  |       Owner:<br>
      Type:  defect    |      Status:  new<br>
  Priority:  normal    |   Milestone:<br>
Component:  varnishd  |     Version:  3.0.3<br>
  Severity:  normal    |  Resolution:<br>
  Keywords:            |<br>
----------------------+-------<u></u>-------------<br>
<br>
Comment (by martin):<br>
<br>
  Hi,<br>
<br>
  Could you verify the minimum number of threads you have configured? This<br>
  sounds like you are running with a only 1 worker thread, and you are being<br>
  hit by Varnish not wanting to create new threads unless there is a real<br>
  workload present needing it. Try increasing the minimum number of threads.<br>
<br>
  Reagrds,<br>
  Martin Blix Grydeland<br>
<br>
</blockquote>
<br>
<br>
-- <br></div>
Reinhard Vicinus<br>
Metaways Infosystems GmbH<br>
Pickhuben 2, D-20457 Hamburg<br>
<br>
E-Mail: <a href="mailto:r.vicinus@metaways.de" target="_blank">r.vicinus@metaways.de</a><br>
Web:    <a href="http://www.metaways.de" target="_blank">http://www.metaways.de</a><br>
Tel:    <a href="tel:%2B49%20%280%2940%20317031-524" value="+4940317031524" target="_blank">+49 (0)40 317031-524</a><br>
Fax:    <a href="tel:%2B49%20%280%2940%20317031-10" value="+494031703110" target="_blank">+49 (0)40 317031-10</a><br>
<br>
Metaways Infosystems GmbH - Sitz: D-22967 Tremsbüttel<br>
Handelsregister: Amtsgericht Lübeck HRB 4508 AH<br>
Geschäftsführung: Hermann Thaele, Lüder-H. Thaele<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><table border="0" cellpadding="0" cellspacing="0" style="font-size:12px;line-height:1.5em;font-family:'Helvetica Neue',Arial,sans-serif;color:rgb(102,102,102);width:550px;border-top-width:1px;border-top-style:solid;border-top-color:rgb(238,238,238);border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);margin-top:20px;padding-top:5px;padding-bottom:5px">
<tbody><tr><td width="100"><a href="http://varnish-software.com" target="_blank"><img src="http://www.varnish-software.com/static/media/logo-email.png"></a><span></span><span></span></td><td><strong style="font-size:14px;color:rgb(34,34,34)">Martin Blix Grydeland</strong><br>
Senior Developer | Varnish Software AS<br>Cell: +47 21 98 92 60<br><span style="font-weight:bold">We Make Websites Fly!</span></td></tr></tbody></table></div><br>
</div>