Which scripting language gives best performance for AGI?

Hi,

We have built a call center application by using MeetMe conferences in Asterisk v13.21.
Our current AGI scripts developed in Perl and PHP, but when we are having more calls it is creating too much load on asterisk and due to that calls are getting skipped and asterisk is getting crashed sometimes.
So, we are thinking to rebuild those AGIs using some other scripting language such as NodeJS, C or Python etc which can give us better performance with high number of calls.

Please share your thoughts.

Thanks in advance.

Are you using AGI or FastAGI? If using AGI then you should move to FastAGI as the way AGI works has inherent performance repercussions at large scale. This is why FreePBX moved their things to FastAGI[1].

[1] https://www.freepbx.org/performance-improvements-in-freepbx/

fastagi should improve performance, as interpreter doesn’t have to be continually reloaded, and any pre-compilation only happens once. Obvious binaries, e.g. compiled C, will be faster to start that true scripts.

Installing HHVM

HHVM is a JIT compiler for PHP and it should improve execution time for the daemons run in PHP

could very nice help

in freeswitch they use lua with a lot success
asterisk has not updated the library a long time but it works

I would have thought that most AGI scripts were not CPU intensive, so there might be slight negative effects from just in time compilation, over simple interpretation.

this is from my experience from live servers before i installed hhvm the sound would be little ruff after i installed it i became good
it is a php problem that need jit

Isn’t eagi() just like agi() but enhanced with inbound audio?

From core show application eagi:

Using ‘EAGI’ provides enhanced AGI, with incoming audio available out of band on file descriptor 3. In all other respects, it behaves in the same fashion as AGI.

fastagi() (if coded correctly) talks to a daemon thus avoiding reloading an interpreter and re-parsing your script.

Personally, I’ve had great success in writing AGIs in C.

It’s not just reloading an interpreter and re-parsing your script, but the act of spawning a process involves forking Asterisk itself. Under heavy use or with large memory consumption this operation can be expensive and time consuming, resulting in increased load and audio issues.

Oops. I’ve now edited my reply.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.