<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-CA link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>There’s no health check in the backend. Not sure what that does with a one hour grace. I set a short grace with<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>  if (req.backend.healthy) {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                set req.grace = 60s;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        } else {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                set req.grace = 4h;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>        }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You also don’t appear to select a backend in recv.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Stefan Caunter <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Operations<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Torstar Digital<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>m: (416) 561-4871<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> varnish-misc-bounces@varnish-cache.org [mailto:varnish-misc-bounces@varnish-cache.org] <b>On Behalf Of </b>Tejaswi Nadahalli<br><b>Sent:</b> March-04-11 1:23 PM<br><b>To:</b> varnish-misc@varnish-cache.org<br><b>Subject:</b> Re: Under Load: Server Unavailable/Connection Dropped/Delayed Reponse<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On Fri, Mar 4, 2011 at 9:43 AM, Caunter, Stefan <<a href="mailto:scaunter@topscms.com">scaunter@topscms.com</a>> wrote:<o:p></o:p></p><div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>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><o:p></o:p></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> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Stefan Caunter </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Operations</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Torstar Digital</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>m: (416) 561-4871</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;border-color:-moz-use-text-color -moz-use-text-color'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span lang=EN-US style='font-size:10.0pt'>From:</span></b><span lang=EN-US style='font-size:10.0pt'> <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><o:p></o:p></p></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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<o:p></o:p></p></div></div></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>