<div dir="ltr">Hi Per,<div><br></div><div>Correcting: At the time the machine was Ubuntu not Amazon Linux.</div><div><br></div><div>We didn't have the proper monitoring at the time and after that we did it some load testing with the request urls and we couldn't reproduce the error. The other machine had this line of error in the syslog.</div><div><br></div><div><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">varnishd[22217]: segfault at 18 ip 00007f061ea62565 sp 00007ef8a87e8170 error 4 in libjemalloc.</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">so.1[7f061ea570</span><span style="color:rgb(51,51,51);font-family:monospace;font-size:12px;line-height:18px">00+30000]</span><br></div><div><br></div><div>Similar to this:</div><div><a href="https://bugs.launchpad.net/ubuntu/+source/jemalloc/+bug/1333581">https://bugs.launchpad.net/ubuntu/+source/jemalloc/+bug/1333581</a><br></div><div><br></div><div>Hi Paul,</div><div><br></div><div>The long TTL would apply for grace? Size down would help the cache evict?</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 3, 2015 at 1:30 PM Per Buer <<a href="mailto:perbu@varnish-software.com">perbu@varnish-software.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote"></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 3, 2015 at 4:08 PM, Caires Vinicius <span dir="ltr"><<a href="mailto:cairesvs@gmail.com" target="_blank">cairesvs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">We had some problems with malloc with the same kind of aws instance and the <span style="font-size:13px;line-height:19.5px">-s malloc,5.8G(80% of the memory total). The only trace of the error was a </span><span style="line-height:19.5px">cannot fork cannot allocate memory into syslog. We're probably missing some point, maybe the instance size ins't the right fit for us.</span></div></blockquote><div><br></div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>This sounds like your running out of virtual memory. Maybe you're running without swap space?</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Per.</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 3, 2015 at 10:56 AM Per Buer <<a href="mailto:perbu@varnish-software.com" target="_blank">perbu@varnish-software.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 3, 2015 at 1:42 PM, Caires Vinicius <span dir="ltr"><<a href="mailto:cairesvs@gmail.com" target="_blank">cairesvs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="margin:0px 10px 1.5em 0px;color:rgb(34,34,34);font-family:'Open Sans',sans-serif;font-size:12px;line-height:18px">We've started to use Varnish 4 with Amazon Linux with EBS SSD of 40GB, memory of 7.5GB. We use the file storage with 20G allocated with ttl of 11 minutes and grace of 5 hours, all the other configs are standard.</p></div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I would, on a general basis, recommend against using the file backend. It will start to struggle with fragmentation relatively quickly and the performance isn't all that great (lots of unnecessary synchronous reads).</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="margin:0px 10px 1.5em 0px;color:rgb(34,34,34);font-family:'Open Sans',sans-serif;font-size:12px;line-height:18px"></p><p style="margin:0px 10px 1.5em 0px;color:rgb(34,34,34);font-family:'Open Sans',sans-serif;font-size:12px;line-height:18px">Sometimes when we have a lot of request that result into cache miss we started to notice that our request latency grows and the iowait stays at 100%, something similar to this <a href="https://www.varnish-cache.org/lists/pipermail/varnish-misc/2008-April/016139.html" rel="nofollow" style="text-decoration:none;color:rgb(30,117,187);background:transparent" target="_blank">https://www.varnish-cache.org/lists/pipermail/varnish-misc/2008-April/01...</a>. And our threads reaches the maximum (1000).</p><p style="margin:0px 10px 1.5em 0px;color:rgb(34,34,34);font-family:'Open Sans',sans-serif;font-size:12px;line-height:18px">Do you guys have any idea why is that? </p></div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Yeah. New objects get assign a piece of memory, starts writing, triggers pagefault, kernel takes over and reads/merges the underlying page, varnish then overwrites that page which then gets written back to disk. This naturally slows down delivery so Varnish spawns new threads.</div><div><br></div><div>Try malloc. You should start with -s malloc,30G or there about - if you have lots of small objects you might need to go a bit down to avoid swapping.</div><div><br></div><div>Not related: You should also move /var/lib/varnish onto tempfs. Linux will do a lot of writing if the shared memory segment is visible on a filesystem that is backed by a disk.</div></div></div></div><div dir="ltr"><div class="gmail_extra">-- <br><div><div dir="ltr"><div><div dir="ltr"><table border="0" cellpadding="0" cellspacing="0" style="border-bottom-width:1px;padding-top:5px;border-top-style:solid;width:550px;padding-bottom:5px;border-bottom-color:rgb(238,238,238);border-top-width:1px;border-bottom-style:solid;line-height:1.5em;border-top-color:rgb(238,238,238);color:rgb(102,102,102);font-size:12px;font-family:'Helvetica Neue',Arial,sans-serif;margin-top:20px"><tbody><tr><td width="100"><img src="http://www.varnish-software.com/static/media/logo-email.png"></td><td><font color="#222222"><span style="font-size:14px"><b>Per Buer</b></span></font><br>CTO | Varnish Software AS<br>Cell: <a value="+4790181750" style="color:rgb(17,85,204)">+47 95839117</a><br><span style="font-weight:bold">We Make Websites Fly!<br><a href="https://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank">www.varnish-software.com</a></span></td></tr></tbody></table><br><div style="color:rgb(136,136,136)"><a href="http://info.varnish-software.com/signature" target="_blank"><img src="http://files.varnish-software.com/signature.png"></a><br></div></div></div></div></div>
</div></div></blockquote></div></div></div></div>
</blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><table border="0" cellpadding="0" cellspacing="0" style="border-bottom-width:1px;padding-top:5px;border-top-style:solid;width:550px;padding-bottom:5px;border-bottom-color:rgb(238,238,238);border-top-width:1px;border-bottom-style:solid;line-height:1.5em;border-top-color:rgb(238,238,238);color:rgb(102,102,102);font-size:12px;font-family:'Helvetica Neue',Arial,sans-serif;margin-top:20px"><tbody><tr><td width="100"><img src="http://www.varnish-software.com/static/media/logo-email.png"></td><td><font color="#222222"><span style="font-size:14px"><b>Per Buer</b></span></font><br>CTO | Varnish Software AS<br>Cell: <a value="+4790181750" style="color:rgb(17,85,204)">+47 95839117</a><br><span style="font-weight:bold">We Make Websites Fly!<br><a href="https://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank">www.varnish-software.com</a></span></td></tr></tbody></table><br><div style="color:rgb(136,136,136)"><a href="http://info.varnish-software.com/signature" target="_blank"><img src="http://files.varnish-software.com/signature.png"></a><br></div></div></div></div></div>
</div></div></blockquote></div>