Under loaded conditions (3 machines doing httperf separately), I did a separate wget on the side, and am attaching the TCPDUMP of that request. As you can see, there is a delay in the middle where varnish didn't respond immediately. If thread/hit-rate conditions are optimal, this delay should be minimal I thought.<br>
<br>Any help would be appreciated.<br><br>-T<br><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 2:30 PM, Tejaswi Nadahalli <span dir="ltr"><<a href="mailto:nadahalli@gmail.com">nadahalli@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Fri, Mar 4, 2011 at 2:25 PM, Caunter, Stefan <span dir="ltr"><<a href="mailto:scaunter@topscms.com" target="_blank">scaunter@topscms.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-CA"><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">There’s no health check in the backend. Not sure what that does with a one hour grace. I set a short grace with</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> if (req.backend.healthy) {</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> set req.grace = 60s;</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> } else {</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> set req.grace = 4h;</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> }</span></p></div></div></blockquote>
</div><div><br>I am still to add health-checks, directors, etc. Will add them soon. But those make sense if the cache-primed performance is good. In my test, I am requesting URLs who I know are already in the cache. Varnishstat also shows that - there are no cache misses at all. <br>
</div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-CA"><div><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">You also don’t appear to select a backend in recv.</span></p></div></div></blockquote></div><div><br>The default backend seems to be getting picked up automatically.<br>
<font color="#888888">
<br>-T<br> </font></div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-CA">
<div><div><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Stefan Caunter </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Operations</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Torstar Digital</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">m: (416) 561-4871</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p></div><div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:varnish-misc-bounces@varnish-cache.org" target="_blank">varnish-misc-bounces@varnish-cache.org</a> [mailto:<a href="mailto:varnish-misc-bounces@varnish-cache.org" target="_blank">varnish-misc-bounces@varnish-cache.org</a>] <b>On Behalf Of </b>Tejaswi Nadahalli<br>
<b>Sent:</b> March-04-11 1:23 PM<div><br><b>To:</b> <a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br></div><b>Subject:</b> Re: Under Load: Server Unavailable/Connection Dropped/Delayed Reponse</span></p>
</div><div><div></div><div><p class="MsoNormal"> </p><p class="MsoNormal">On Fri, Mar 4, 2011 at 9:43 AM, Caunter, Stefan <<a href="mailto:scaunter@topscms.com" target="_blank">scaunter@topscms.com</a>> wrote:</p>
<div><blockquote style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); border-width: medium medium medium 1pt; padding: 0cm 0cm 0cm 6pt; margin-left: 4.8pt; margin-right: 0cm;">
<div><div><p class="MsoNormal"> </p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">What does something like firebug show when you request during the load test? The delay may be anything from DNS to the ec2 network.</span></p>
</div></div></blockquote><div><p class="MsoNormal"><br>The DNS requests are getting resolved super quick. I am unable to see any other network issues with EC2. I have a similar machine in the same data center running nginx which is doing similar loads, but with no caching requirement, and it's running fine.<br>
<br>In my first post, I forgot to attach my VCL, which is a bit too minimal. Am I missing something obvious?<br><br>------<br>backend default0 {<br> .host = "10.202.30.39";<br> .port = "8000";<br>
}<br><br>sub vcl_recv {<br> unset req.http.Cookie;<br> set req.grace = 3600s;<br> set req.url = regsub(req.url, "&refurl=.*&t=.*&c=.*&r=.*", "");<br>}<br><br>sub vcl_deliver {<br>
if (obj.hits > 0) {<br> set resp.http.X-Cache = "HIT";<br> } else {<br> set resp.http.X-Cache = "MISS";<br> }<br>}<br>-------------------------<br><br>Could there be some kind of TCP packet pileup that I am missing?<br>
<br>-T<br> </p></div><blockquote style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); border-width: medium medium medium 1pt; padding: 0cm 0cm 0cm 6pt; margin-left: 4.8pt; margin-right: 0cm;">
<div><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Stefan Caunter </span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);">Operations</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Torstar Digital</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">m: (416) 561-4871</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><div style="border-style: solid none none; border-color: -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:varnish-misc-bounces@varnish-cache.org" target="_blank">varnish-misc-bounces@varnish-cache.org</a> [mailto:<a href="mailto:varnish-misc-bounces@varnish-cache.org" target="_blank">varnish-misc-bounces@varnish-cache.org</a>] <b>On Behalf Of </b>Tejaswi Nadahalli<br>
<b>Sent:</b> March-04-11 1:09 AM<br><b>To:</b> <a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br><b>Subject:</b> Under Load: Server Unavailable/Connection Dropped/Delayed Reponse</span></p>
</div><div><div><p class="MsoNormal"> </p><p class="MsoNormal">Hi Everyone,<br><br>I am seeing a situation similar to : <br><br><a href="http://www.varnish-cache.org/lists/pipermail/varnish-misc/2011-January/005351.html" target="_blank">http://www.varnish-cache.org/lists/pipermail/varnish-misc/2011-January/005351.html</a> (Connections Dropped Under Load)<br>
<a href="http://www.varnish-cache.org/lists/pipermail/varnish-misc/2010-December/005258.html" target="_blank">http://www.varnish-cache.org/lists/pipermail/varnish-misc/2010-December/005258.html</a> (Hanging Connections)<br>
<br>I have httperf loading a varnish cache with never-expire content. While the load is on, other browser/wget requests to the varnish server get delayed to 10+ seconds. Any ideas what could be happening? ssh doesn't seem to be impacted. So, is it some kind of thread problem?<br>
<br>In production, I see a similar situation with around 1000 req/second load. <br><br>I am running varnishd with the following command line options (as per <a href="http://kristianlyng.wordpress.com/2009/10/19/high-end-varnish-tuning/" target="_blank">http://kristianlyng.wordpress.com/2009/10/19/high-end-varnish-tuning/</a>):<br>
<br>sudo varnishd -f /etc/varnish/default.vcl -s malloc,5G -T <a href="http://127.0.0.1:2000" target="_blank">127.0.0.1:2000</a> -a <a href="http://0.0.0.0:80" target="_blank">0.0.0.0:80</a> -p thread_pools=8 -p thread_pool_min=100 -p thread_pool_max=5000 -p thread_pool_add_delay=2 -p cli_timeout=25 -p session_linger=100 -p lru_interval=20 -t 31536000<br>
<br>I am on Ubuntu Lucid 64 bit Amazon EC2 C1.XLarge with 8 processing units.<br><br>My network sysctl parameters are tuned according to: <a href="http://varnish-cache.org/trac/wiki/Performance" target="_blank">http://varnish-cache.org/trac/wiki/Performance</a><br>
fs.file-max = 360000<br>net.ipv4.ip_local_port_range = 1024 65536<br>net.core.rmem_max = 16777216<br>net.core.wmem_max = 16777216<br>net.ipv4.tcp_rmem = 4096 87380 16777216<br>net.ipv4.tcp_wmem = 4096 65536 16777216<br>net.ipv4.tcp_fin_timeout = 3<br>
net.core.netdev_max_backlog = 30000<br>net.ipv4.tcp_no_metrics_save = 1<br>net.core.somaxconn = 262144<br>net.ipv4.tcp_syncookies = 0<br>net.ipv4.tcp_max_orphans = 262144<br>net.ipv4.tcp_max_syn_backlog = 262144<br>net.ipv4.tcp_synack_retries = 2<br>
net.ipv4.tcp_syn_retries = 2<br><br><br>Any help would be greatly appreciated</p></div></div></div></div></blockquote></div><p class="MsoNormal"> </p></div></div></div></div></blockquote></div></div></div><br>
</blockquote></div><br>