<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi Andre,</p>
<p>Good call!</p>
<p>I think it needs to be in addition to fixing the script, but i've done this too!</p>
<p>With the periodic processing pushed to a thread, we continue to see what looks like correct values (roughly 2x what we saw before), just with a memory leak, which we have temporarily worked around by restarting the script every few hours.</p>
<p>The graph is also a LOT smoother than before - we just occasionally get a short period of spikes - if we're lucky, the buffer increase might solve that!</p>
<p>https://portal.lonap.net/statistics/vlan</p>
<p>Thanks,</p>
<p>Ian</p>
<p><br /></p>
<p id="reply-intro">On 2023-06-29 08:52, André Grüneberg wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div dir="ltr">
<div>Hi,</div>
<div> </div>
<div>I didn't know where exactly to jump into the conversation. So I'd take the tail.</div>
<div>I eventually followed another lead. What happens while the sflow-to-rrd-handler script is flushing data into RRDs?</div>
<div>Well, it's not reading from the input pipe fed by sflowtool. Ok, there should be a buffer on the pipe?!</div>
<div>But eventually sflowtool will block processing, because it cannot feed data into the output pipe.</div>
<div>On the other end of sflowtool, it receives UDP datagrams. Isn't there a buffer? And indeed, Linux is buffering the inbound flow of UDP.</div>
<div> </div>
<div>So I looked at `netstat -uanp | grep 6343` ... second column (Recv-Q) show the use of the buffer. From time to time (during flush), the buffer is filled ... and maxes out at ~200k.</div>
<div>Next I increased the buffer size to 25M using sysctl:</div>
<div>net.core.rmem_max=26214400<br />net.core.rmem_default=26214400</div>
<div> </div>
<div>After a restart of the script, I can see that the receive queue fills up to ~10 MiB.</div>
<div> </div>
<div>Looking at the graphs I see an improvement (<a href="https://www.bcix.de/ixp/statistics/vlan/1/ipv4/bits" target="_blank" rel="noopener noreferrer">https://www.bcix.de/ixp/statistics/vlan/1/ipv4/bits</a>, ~9:30 today).</div>
<div> </div>
<div>Maybe this helps others?!</div>
<div> </div>
<div>André</div>
</div>
<div class="v1gmail_signature" dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<p><br /></p>
<span style="font-size: xx-small;"><span style="font-family: Calibri,'sans-serif';"></span></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</body></html>