<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@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-GB" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<p style="font-family:Calibri;font-size:10pt;color:#000000;margin:5pt;" align="Right">
Confidential<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">That’s a good tip – had not seen that particular setting, we were getting ready to do a full scheduled restart across the servers! Will give your suggestion a go in the meantime<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Z<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> dancer-users <dancer-users-bounces@lists.preshweb.co.uk>
<b>On Behalf Of </b>Hermann Calabria<br>
<b>Sent:</b> 29 March 2021 18:52<br>
<b>To:</b> dancer-users@lists.preshweb.co.uk; dancer-users@dancer.pm<br>
<b>Subject:</b> Re: [dancer-users] Debugging memory leaks<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">We have experienced the same issue -- memory leaks -- with our Dancer-based app. Not sure if it's Dancer, underlying Perl, or UWSGI itself, but haven't been able
to debug and would certainly appreciate any tips!<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">As a
<b><u>workaround</u></b>, we use the reload-on-rss option on UWSGI to reload bloated workers. Here's a recipe, with sample settings:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">processes = 6 # have 6 workers loaded simultaneously<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">reload-on-rss = 800 # if a worker reaches 800MB RSS allocated, reload it after it finishes.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">harakiri = 120 # (for good measure) hung workers die after 120 seconds<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">The reload-on-rss setting obviously depends on the size of your app, with a bit of headroom for it to bloat until it gets restarted. Make sure (# of processes)
* (reload-on-rss) < (available memory).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid windowtext 1.0pt;padding:0cm 0cm 0cm 8.0pt;margin-left:0cm;margin-top:15.0pt;margin-bottom:5.0pt;min-width: 500px">
<p style="margin-top:7.5pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#AAAAAA">On 3/29/2021 9:39:58 AM, Zahir Lalani <<a href="mailto:zahirlalani@oliver.agency">zahirlalani@oliver.agency</a>> wrote:<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">Confidential
<br>
<br>
Hi all <br>
<br>
Wondering if I can get some guidance. Our application is growing in use and have recently found that UWSGI runs out of worker resources - but when we use uwsgitop, its more that memory has shot up. The only way to resolve is a restart of uwsgi.
<br>
<br>
That sounds like a memory leak, but I am not sure what tools can help me in that regard. I assumed that Perl was quite good at cleanup, but something is not right here.
<br>
<br>
Any guidance appreciated <br>
<br>
Z <br>
_______________________________________________ <br>
dancer-users mailing list <br>
<a href="mailto:dancer-users@lists.preshweb.co.uk">dancer-users@lists.preshweb.co.uk</a>
<br>
<a href="https://lists.preshweb.co.uk/mailman/listinfo/dancer-users">https://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a>
<o:p></o:p></span></p>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>