[asterisk-users] VERY HIGH LOAD AVERAGE: top - 10:27:57 up 199 days, 5:18, 2 users, load average: 67.75, 62.55, 55.75

Steve Edwards asterisk.org at sedwards.com
Wed Feb 10 02:16:36 CST 2010


On Wed, 10 Feb 2010, Muro, Sam wrote:

[snip]

> I have the agi scripts not as ivr but to help populate the required 
> information into mysql db. Probably here is where the problem lies i 
> have to connect and disconnect to mysql each time a call is made or a 
> specific menu is selected
>
> Here is the script
> *****
> #!/usr/bin/perl -w

[snip]

You can execute xxx AGIs written in a compiled language like C in the time 
it takes to load the Perl interpreter and parse your script.

[snip]

> # Trying to resolve memory leak should it happen
> delete($ARGV[0]);
> delete($ARGV[1]);
> delete($ARGV[2]);
> delete($ARGV[3]);
> delete($ARGV[4]);
> delete($ARGV[5]);
> delete($ARGV[6]);
> delete($ARGV[7]);

Not part of your issue, but any memory leakage in a process (which is what 
Asterisk creates to execute your AGI) is automagically cleaned up when the 
process is terminated.

Since all your AGI does is take a bunch of channel variables (I'm assuming 
a little bit here) and stuff them into your database, this would be simple 
(but ugly) to code directly into the dialplan.

My preference would be to keep the database cruft in an AGI written in C. 
The performance should be an order of magnitude or two better and you can 
keep your dialplan clean and maintainable.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list