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

Varnish varnish-bugs at varnish-cache.org
Wed Dec 5 12:49:52 CET 2012


#1236: requests to same url sometimes hang
----------------------+----------------------
 Reporter:  reinhard  |       Type:  defect
   Status:  new       |   Priority:  normal
Milestone:            |  Component:  varnishd
  Version:  3.0.3     |   Severity:  normal
 Keywords:            |
----------------------+----------------------
 The problem is, that if a script with some parameters takes a long time to
 execute it sometimes happens, that a call to the script with other
 parameters hangs till the first long running call is finished.

 we use a plain centos 6.3 with the newest varnish 3.0.3 rpms from
 http://repo.varnish-cache.org/redhat/varnish-3.0/el6/x86_64/.

 We were able to reproduce this behavior with the following setup. It
 doesn't happens always but on the server i tested it around 1 in 3 times
 so it should be fairly easy to reproduce. Attached is the script test.php.
 The important part is that the script sleeps 30 seconds if it is called
 with the parameter t=1 otherwise it returns some output i used in
 debugging the problem.

 The following steps must be done to reproduce the problem:

 1.) restart varnish

 2.) call the script with the parameter that the script takes a long time
 to finish: curl -i -H "host: test.de"
 'localhost:6081/test.php?t=1&time='`date +%H_%M_%S`

 3.) call the script with a parameter that finish fast. The first call
 always works and don't hang: curl -i -H "host: test.de"
 'localhost:6081/test.php?t=2&time='`date +%H_%M_%S`

 4.) call the script with a parameter that finish fast a second time
 immediately afterwards: curl -i -H "host: test.de"
 'localhost:6081/test.php?t=3&time='`date +%H_%M_%S`

 If i waited to long with the third call, i wasn't able to reproduce the
 problem. Even if i was fast only around 1 in 3 attempts showed the
 problem: The call waited till the first call was finished before
 initiating a connection to the backend server.

 I have also attached the log file of varnishlog -u -O -w varnish2.log
 during the execution. The problem also occurs with varnish 2.1.5. Please
 let me know if you need further informations.

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1236>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list