we are developing a platform based on Asterisk for Telecom services.
The architecture includes 2 opensips, 3 asterisk and PJSIP.
The dialplans are written in simple asterisk conf files and for more complex functionality, we have employed PHP-AGI scripts.
However, at high traffic, we observed high CUP load, delays of message processing, task processor queues getting filled and finally the end of service. Issue is fixed via a service restart.
After stress test we concluded to the following:
In case of a simple dialplan consisting of a simple Playback(Hello-World) on asterisk conf files (dialplan), we can support huge incoming rates (>300 calls per second).
If we add an extra line of calling a PHP-AGI script, that does a simple variable assignment, the max incoming rate that we can support is about 30calls per second.
It is obvious that the call of the PHP-AGI script is a significant factor that causes the observed errors.
Our question is how we can solve this problem? What is the most optimal way to replace the existing PHP-AGI scripts? We think of fast-AGI and PHP script, but we really need an expert advice on this topic.
(Asterisk Gateway Interface (AGI) - Asterisk Project - Asterisk Project Wiki)
Thank you in advance for your time.