Dear Asterisk Community,
I am building an Asterisk solution (high level architecture: SIP trunk, Opensips + Asterisk configuration, PJSIP connectivity) and I am currently performing stress tests on the platform.
I observed delays, in case of concurrent calls, however the number is not quite large (fewer than 200 concurrent calls), in order to justify this behavior.
After investigating the logs, I found out that the delays are inserted, when dialplan tries to handle CDR variables.
Let me here explain a bit: I have introduced a large number of CDR custom variables (25 of them) that are needed for my solution (they are written to DB via ODBC at the end of the call). When the dialplan tries to set to a custom CDR variable a value (e.g. CDR(custom_var1)=30, CDR(custom_var2)=10, etc), I can see from the logs that it may be needed a couple of seconds in order to process the corresponding command. The delays seem to be created from these commands.
I tried to investigate if the large number of custom CDR variables can have an impact on the performance.
I found the performance tuning page ( Performance Tuning - Asterisk Project - Asterisk Project Wiki ), I set up the statis.conf according to the proposed values (not the PJSIP, do I need to configure also PJSIP threadpool?). The situation was improved, however issue still remains.
I tried to perform an initialization of all custom CDR variables via ARRAY(), in order to allocate memory for all custom CDR variables once. But the problem was not solved.
How could I handle this issue? The large number of custom CDR variables can indeed create a performance issue? Is there a proposed configuration that could solve the problem?
If issue could not be solved otherwise, I will collect all the data needed (via non-CDR variables) and send them to DB via ODBC once the call is ended (at hangup handler). However, the CDR solution is more straightforward and I would like to use an existing functionality of Asterisk for my solution.
Thank you all in advance for your time and interest.