<p dir="ltr">I have ven working with MySQL since 3.x</p>
<p dir="ltr">Check the following</p>
<p dir="ltr">A close connections in lua<br>
B rise max connections in my.cnf<br>
C. Make connections time out minutes instead hours<br>
This is in my.cfn<br>
D rise threads<br>
E rise table caching<br>
F use indexes. Correct ones<br>
G add memcached support to your lua script where you can</p>
<p dir="ltr">You will see a better performance.</p>
<div class="gmail_quote">Le 13 nov. 2015 8:20 AM, "Florent Krieg" <<a href="mailto:flokrrr@gmail.com">flokrrr@gmail.com</a>> a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello John,</div><div><br></div><div>If you are under heavy load, could this be a db issue? Like the db engine taking long to return the data, hence queries are getting queued one after the other and finally reach a few hundreds of it?</div><div>Or you are right and your Lua script sometimes doesn't release the handler as it just shall... To check this, you could for instance log a debug message before and after doing your db query, and check after a few minutes if you have the equivalent of 'before' and 'after' query messages... If more before than after, then something is happening.</div><div><br></div><div>You could do a 'show processlist;' on the MySQL cli too to understand what are exactly the few hundreds of open connections.</div><div><br></div><div>Also, is your stored procedure complicated? I'm not DBA but if it's too tricky, you could imagine to move the load on the Lua processing instead of MySQL. I have the same use cases on my environment and I made sure my MySQL queries are dumb as possible and I take the benefit of Lua to process the data returned.</div><div><br></div><div>I'm just dropping some ideas that I'm thinking about now. Nothing very precise though (sorry...).</div><div>Florent</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-13 12:49 GMT+01:00 John Nash <span dir="ltr"><<a href="mailto:john.nash778@gmail.com" target="_blank">john.nash778@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>I am calling a lua script from dialplan which does following steps ...<br><br></div>1- Gets freeswitch dbh handle (odbc mysql)<br></div>2- Runs a mysql stored procedure which returns balance remaining amount for the subscriber who made call.<br></div>3- Save the amount in session variable and released dbh handle<br></div>4- Play sound files as per output received and saved in step 3<br><br></div>Now upto 200 calls and first 2-3 hours of start all work fine. I can see in Database that script uses 32 connections approx at a given time (I think connection pooling works) but suddenly connections start increasing and go upto 300+ and because of that database stops responding and i have to kill freeswitch to make production DB responsive again.<br><br></div>I am not sure where and what I should check. Can someone give me pointers on what I can check?..Or I am doing something fundamentally wrong.<br><br></div>Can there be such a case where lua scripts hang and never release connection?<br><div><div><div><br><br><br><br><br></div></div></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div>