<p>Thanks, we're trying to serve as large amount as we can on a single kamailio server.<br>
Anyway, after some test, I found the problem may related to debug level.</p>

<p>If I switch on memdbg, it'll have a HUGE impact to kamailio and cause TCP connection drop.<br>
If I leave debug=-2, then it runs well.</p>

<p>Normally it should not switch on memlog on a running production server.<br>
So I think this issue can be closed now.</p>

<p>Again, thank you for all your great contributions, really appreciate your help.</p>

<h3>Further information if anyone interest in</h3>

<p>Env:</p>

<pre><code>start kamailio with pkg 2G, shm 2G
sipp with 1000 RPS
</code></pre>

<h4>TEST 1: with memdbg on ( lots of logs write to syslog )</h4>

<p>It will drop tcp connection along with shm goes down.<br>
And sipp will stop and shows <code>Broken pipe on TCP connection, remote peer probably closed the socket.</code></p>

<h4>TEST 2: disable all logs, at log level -2, nearly no logs at all</h4>

<p>It runs well, and did not keep swallowing shm at this level.<br>
free shm 208811808 more or less.</p>

<pre><code>root@SIP-B03:~# kamcmd core.shmmem
{
    total: 1073741824
    free: 208811808
    used: 862058976
    real_used: 864930016
    max_used: 864952488
    fragments: 253
}
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/296#issuecomment-138469916">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZYJOONHh2QEj9-dCdp7tQjnn0pwwks5ovo-XgaJpZM4Fw0dn.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/296#issuecomment-138469916"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>