Thanks Henning,<div><br></div><div>I'll go with to recompile option and post the results...</div><div><br></div><div>Regards</div><div><br></div><div>Javier<br><br><div class="gmail_quote">2011/2/21 Henning Westerholt <span dir="ltr"><<a href="mailto:henning.westerholt@1und1.de">henning.westerholt@1und1.de</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Monday 21 February 2011, Javier Gallart wrote:<br>
> we are running kamailio 3.1.1. Basically for every call it has to query a<br>
> mtree that is reloaded every 15 minutes. The mtree table is about 4M<br>
> records and is stored in a Pgostgres database. For the reload we use the<br>
> command mi mt_reload embedded in a xmlrpc request. The code for this is:<br>
> route[XMLRPC]{<br>
> if (method == "POST" || method == "GET")<br>
> {<br>
> if (search("^User-Agent:"))<br>
> {<br>
> xlog("xmlrpc request\n");<br>
> set_reply_close();<br>
> set_reply_no_connect(); # optional<br>
> dispatch_rpc();<br>
> }<br>
> exit;<br>
> }<br>
> }<br>
> This server has been running with no issued for some weeks now, but at some<br>
> point during the weekend the mi command started to fail. This is what the<br>
> logs show:<br>
><br>
> ERROR: <core> [db_res.c:181]: no private memory left<br>
> ERROR: db_postgres [km_res.c:225]: could not allocate rows<br>
> ERROR: db_postgres [km_dbase.c:280]: failed to convert rows<br>
> ERROR: mtree [mtree_mod.c:627]: Error while fetching result<br>
> ERROR: db_postgres [km_dbase.c:318]: invalid parameter value<br>
> ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database<br>
><br>
> I've restarted kamailio and now it's working fine. Should we increase the<br>
> private memory? On the other hand, we'd like to detect this failure<br>
> condition on the script and act accordingly (for instance sending an email<br>
> with an alarm message), is there anyway to do this?<br>
<br>
</div></div>Hi Javier,<br>
<br>
this probably caused of the fragmentation of the internal private memory pool<br>
from the frequent dumps and other load. You could increase the pool, or better<br>
- switch the MI to the system memory pool by uncommenting this line in<br>
kmi/Makefile<br>
<br>
#DEFS+= -DMI_SYSTEM_MALLOC<br>
<br>
and recompile the server.<br>
<br>
Cheers,<br>
<font color="#888888"><br>
Henning<br>
</font></blockquote></div><br></div>