Hi everyone,
We’re encountering a recurring issue with Asterisk running inside Docker containers. Specifically:
-
There is a noticeable delay in system recordings (IVRs, prompts).
-
Actual conversation audio has lower delay but is still slightly affected.
-
The issue resolves temporarily after restarting Asterisk, but it returns after some time.
-
We are running around 80 active calls concurrently.
-
The server has ample resources (CPU, RAM, etc.).
Please confirm that Asterisk is the only application using significant CPU on the machine. This may be due to contention with other applications. I don’t think docker has the mechanisms to mitigate contention for real time applications.
@david551 Yes, Asterisk is the only major CPU consumer. We’re using AGI with multiple MySQL operations per call—could that be contributing to the delay in system recordings?Do you think moving Asterisk to run directly on the host (outside Docker) could significantly help with this kind of latency issue? Or are there any recommended tweaks (CPU pinning, real-time kernel, Docker resource limits, etc.) that might help mitigate the delay without abandoning the containerized setup?
In that case Docker is probably not relevant to the problem, and you need to understand where the delays are coming from. They generally come from either resource contention for CPU, or resource contention for the network.
Hello, here are my two cents:
When a client wants to scale with Docker I do not suggest it, mainly because Docker or any other container will add a network layer, so it is necessary to consider this new NAT layer for asterisk configuration and develop your ARI app considering this scenario.
Now, an Asterisk instance can handle 80 active calls without problems, this is what I can suggest, use an Asterisk instance on your host or virtual machine, with the most direct access to your public IP and you will solve many problems in the future, for security, whether or not a fail2ban.
All that remains is to adjust Asterisk configuration and your main AGI application to handle this scenario, considering a single main Asterisk instance.
Greetings!
I’m curious if you are storing your IVR prompts local or somewhere remote. If remote, it could be caused by latency in that storage when call volume increases.
I’ve seen terrible delays when trying to play prompts from some forms of cloud storage.