Hi Carsten,<div><br></div><div>I&#39;ll take a look to that module to learn how it should be done.</div><div><br></div><div>Thanks a lot!.</div><div><br></div><div>Carlos.</div><div><br><div class="gmail_quote">On Fri, Feb 22, 2013 at 1:45 PM, Carsten Bock <span dir="ltr">&lt;<a href="mailto:carsten@ng-voice.com" target="_blank">carsten@ng-voice.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Carlos,<br>
<br>
i hope you are doing fine :-)<br>
You may run into troubles, if your timer process takes too long; so<br>
you might consider using a separate process for &quot;expensive&quot;<br>
operations, maybe you want to look at the nathelper module, which does<br>
the trick.<br>
<br>
Kind regards,<br>
Carsten<br>
<br>
<br>
2013/2/18 Carlos Ruiz Díaz &lt;<a href="mailto:carlos.ruizdiaz@gmail.com" target="_blank">carlos.ruizdiaz@gmail.com</a>&gt;:<br>
<div><div>&gt; Hello list,<br>
&gt;<br>
&gt; I have a custom made module which uses a timer to monitor some statuses in a<br>
&gt; period of 1 second. Inside the function there&#39;s a loop that iterates over a<br>
&gt; table that can contain several hundreds of items and using each of them to<br>
&gt; perform some arithmetical operations.<br>
&gt;<br>
&gt; Under certain conditions, the number of items can grow to a few thousands in<br>
&gt; really exceptional cases and I believe this situation is causing Kamailio&#39;s<br>
&gt; slow timer process to consume more than 90% of CPU hanging up the other<br>
&gt; group of processes.<br>
&gt;<br>
&gt; My questions are:<br>
&gt;<br>
&gt; - What is the best way to perform a repetitive task such as a loop in a<br>
&gt; timely basis taking in consideration a precision of at least 5 seconds? I&#39;m<br>
&gt; currently registering a function using register_timer() call.<br>
&gt;<br>
&gt; - Can a loop that takes more than 1 second to complete be causing this<br>
&gt; extremely high CPU consumption?<br>
&gt;<br>
&gt; Below is a copy of the top command when the event occurred:<br>
&gt;<br>
&gt; PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND<br>
&gt; 22969 root      20   0 2140m  16m  14m R 98.8  0.1   7:22.03 kamailio<br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt;<br>
&gt; --<br>
&gt; Carlos<br>
&gt; <a href="http://caruizdiaz.com" target="_blank">http://caruizdiaz.com</a><br>
&gt; <a href="tel:%2B595981146623" value="+595981146623" target="_blank">+595981146623</a><br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; sr-dev mailing list<br>
&gt; <a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a><br>
&gt; <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
Carsten Bock<br>
CEO (Geschäftsführer)<br>
<br>
=============================================================<br>
Visit us on the Kamailio World 2013, 16./17. April 2013<br>
=&gt; <a href="http://conference.kamailio.com/k01/" target="_blank">http://conference.kamailio.com/k01/</a>                             See<br>
you there!<br>
=============================================================<br>
<br>
ng-voice GmbH<br>
Schomburgstr. 80<br>
D-22767 Hamburg / Germany<br>
<br>
<a href="http://www.ng-voice.com" target="_blank">http://www.ng-voice.com</a><br>
mailto:<a href="mailto:carsten@ng-voice.com" target="_blank">carsten@ng-voice.com</a><br>
<br>
Office <a href="tel:%2B49%2040%2034927219" value="+494034927219" target="_blank">+49 40 34927219</a><br>
Fax <a href="tel:%2B49%2040%2034927220" value="+494034927220" target="_blank">+49 40 34927220</a><br>
<br>
Sitz der Gesellschaft: Hamburg<br>
Registergericht: Amtsgericht Hamburg, HRB 120189<br>
Geschäftsführer: Carsten Bock<br>
Ust-ID: DE279344284<br>
<br>
Hier finden Sie unsere handelsrechtlichen Pflichtangaben:<br>
<a href="http://www.ng-voice.com/imprint/" target="_blank">http://www.ng-voice.com/imprint/</a><br>
<br>
_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Carlos<div><a href="http://caruizdiaz.com" target="_blank">http://caruizdiaz.com</a></div><div><a href="tel:%2B595981146623" value="+595981146623" target="_blank">+595981146623</a></div>

</div>