<p>There are different types of kamailio processes (children), not easy to have a framework for doing mysql pings when is nothing else to do. Also, there could be executed code continuously but not involving mysql (e.g., receiving keepalive requests and replying to them).</p>

<p>What process gets to be selected for handing a sip udp packet is decided by kernel. For tcp, is an internal dispatcher of tcp connections based on least loaded worker.</p>

<p>If you know you have some constant traffic without mysql involvement, you can add a basic query that doesn't take resources with sqlops, like sql_query("describe table version") or "select now()...".</p>

<p>Worth looking at mysql server and client library setting for connections lifetime, maybe they have some settings there.</p>

<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/406#issuecomment-163030130">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZUN7mIQXWlkRxq9a7Z07EPfHYKPtks5pN0kCgaJpZM4Gmb_R.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/406#issuecomment-163030130"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>