Hi Carsten,<div><br></div><div>I'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"><<a href="mailto:carsten@ng-voice.com" target="_blank">carsten@ng-voice.com</a>></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 "expensive"<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 <<a href="mailto:carlos.ruizdiaz@gmail.com" target="_blank">carlos.ruizdiaz@gmail.com</a>>:<br>
<div><div>> Hello list,<br>
><br>
> I have a custom made module which uses a timer to monitor some statuses in a<br>
> period of 1 second. Inside the function there's a loop that iterates over a<br>
> table that can contain several hundreds of items and using each of them to<br>
> perform some arithmetical operations.<br>
><br>
> Under certain conditions, the number of items can grow to a few thousands in<br>
> really exceptional cases and I believe this situation is causing Kamailio's<br>
> slow timer process to consume more than 90% of CPU hanging up the other<br>
> group of processes.<br>
><br>
> My questions are:<br>
><br>
> - What is the best way to perform a repetitive task such as a loop in a<br>
> timely basis taking in consideration a precision of at least 5 seconds? I'm<br>
> currently registering a function using register_timer() call.<br>
><br>
> - Can a loop that takes more than 1 second to complete be causing this<br>
> extremely high CPU consumption?<br>
><br>
> Below is a copy of the top command when the event occurred:<br>
><br>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND<br>
> 22969 root 20 0 2140m 16m 14m R 98.8 0.1 7:22.03 kamailio<br>
><br>
> Thanks in advance,<br>
><br>
> --<br>
> Carlos<br>
> <a href="http://caruizdiaz.com" target="_blank">http://caruizdiaz.com</a><br>
> <a href="tel:%2B595981146623" value="+595981146623" target="_blank">+595981146623</a><br>
><br>
</div></div>> _______________________________________________<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>
><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>
=> <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>