[asterisk-users] Asterisk AGI issues (at high load)

Elliot Otchet elliot.otchet at callingcircles.com
Thu Jun 4 13:55:04 CDT 2009


Are you using freetds?  Is it a recent version or something that is a few years old?  Are you using a freetds connection pool? http://www.freetds.org/userguide/tdspool.htm

Is unixODBC pooling turned on?  See: http://www.unixodbc.org/doc/conn_pool.html to understand why this doesn't work with AGI type applications.

Are the AGI's running for the entire duration of the call?   If so, are DB open/closes performed immediately before and after each SQL statement?  If not, and your AGI is in play during the entire call (which sounds like the case), your DB connections are probably timing out.

Does your SQL server have enough CALs to support one (or more depending on your logic) or more connections per AGI?  In your fully loaded model, you may be hitting a CAL limit.  Are you running server or processor licenses? MSSQL "Server" licenses have CALS, "Processor" licenses do not (generally speaking).  For SQL2008 see: http://download.microsoft.com/download/1/e/6/1e68f92c-f334-4517-b610-e4dee946ef91/2008%20SQL%20Licensing%20Overview%20final.docx

Possible ways to move forward:
Re-engineer the application with the current language to only be an AGI when an AGI feature is needed.  Make use of DeadAGI or dialplan ODBC extensions (with channel variables) if you need to do post call processing (e.g. update the hangup time to deduct minutes).

Build your own PHP and optimize it for what you need to do AGI to get the memory usage down (if needed).  Yes you really do use significant amounts of memory on a vanilla php install per process if you use stock PHP.  If you can get away with moving to C, it is orders of magnitude more scalable.  Keep in mind though, you may be able to reduce (by significant amounts) the amount of system memory you're using by re-engineering the application.  You should also consider moving this off your call processing system so AGI processing (with scripting languages that use large amounts of memory) can impact your call quality.

Regards,

Elliot

From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deepak
Sent: Thursday, June 04, 2009 1:18 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Asterisk AGI issues (at high load)

BTW,we are using an ODBC connection to Microsoft SQL Server.
We are not using MySQL.

Would that be a possible cause?

Thanks



On Thu, Jun 4, 2009 at 12:31 PM, David Backeberg <dbackeberg at gmail.com<mailto:dbackeberg at gmail.com>> wrote:
On Thu, Jun 4, 2009 at 12:15 PM, Deepak <dlalmtl at gmail.com<mailto:dlalmtl at gmail.com>> wrote:
> Hi, we are experiencing a strange issue and I am hoping someone can point me
> to the right direction or help out with some pointers.
>
> We have asterisk 1.6.0.6 with a sangome a104DE card. We have basically 4
> T1's for a total of DAHDI 96 channels.
>
> We have an agi application (php) that acts as a kind of a calling card
> application.
>
> All users are SIP users that make calls and asterisk then bridges the calls
> over T1 to the PSTN (after running agi script). Codec between SIP clients
> and Asterisk is G729 (96 G729 licenses installed on Asterisk).
> System has 12 GB of RAM.
>
>
> What we are seeing is the following:
>
> 1) All is fine till about 70 calls (70 active calls as displayed by core
> show channels). But as soon as traffic increases, we see the the a lot of
> AGI Processes are running and the number of active calls keeps on GROWING to
> 120, 130, ... . THis makes no sense since we can have a maximum of 96 active
> calls (4 T1). People calling start experiencing delays (10-15 seconds before
> calls are answered or connected, etc.). Upon doing a "ps -ef" we see a lot
> of AGI processes running that seem to keep growing
There could be a number of external constraints that are causing this.
One that comes to mind to is something waiting for a database
connection, then all the other processes that are waiting for the
database pile up and can't exit until they get their turn.

Do you have a max number of connections on your database? How does the
AGI know what to do based on the 'calling card information'? I'm
guessing you store all that in a database, then deduct what the caller
uses, etc.

You may also enjoy http://us3.php.net/set_time_limit

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com<http://www.api-digital.com/> --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


________________________________
This message is intended only for the use of the individual (s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to Calling Circles LLC and its affiliates. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication in error, please notify the sender immediately and delete the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090604/58ba63f7/attachment-0001.htm 


More information about the asterisk-users mailing list