Concurrent Calls Limit on Asterisk

Hi all,

I am having issues with terminating more than 120 calls with asterisk. I noticed when concurrent calls hit 120 and above, it gives errors like “Maximum Number Of Open Files / File Descriptors (FD)” and some other mysql errors.

I am using Ubuntu 16.04 and Asterisk 13.38

please help, here’s my settings

CLI> core show settings

PBX Core settings

Version: 13.38.3
Maximum calls: Not set
Maximum open file handles: 1024
Root console verbosity: 0
Current console verbosity: 0
Debug level: 0
Maximum load average: 0.000000
Minimum free memory: 0 MB
Startup time: 10:16:41
Last reload time: 10:16:41
System: Linux/4.4.0-131-generic built by root on x86_64 2022-09-13 13:33:28 UTC
System name:
Entity ID: 00:50:56:9c:ef:66
PBX UUID: d5809bad-fe78-4df7-94f5-a4256d3de994
Default language: en
Language prefix: Enabled
User name and group: /
Executable includes: Disabled
Transcode via SLIN: Enabled
Transmit silence during rec: Disabled
Generic PLC: Enabled
Generic PLC on equal codecs: Disabled
Min DTMF duration:: 80
Cache media frames: Enabled
RTP dynamic payload types: 96-127

If you are getting similar errors from MySQL, you may need to find an equivalent option for it.

thank you David, I have increased maxfiles to 999999. shall I need to increase max calls and max load also?

max calls is commented out, and is displayed as “not set”. Did you remove the ; comment marker from maxfiles?

max_load is also disabled. Note that this is relative to the actual load on the system, although the more cores you have, the higher you can set this. What I’m trying to say is that exceeding a reasonable value of this parameter means the system is in distress, and it may well be better to refuse calls than allow that to happen. The fix, in that case, is a more powerful machine, not parameter tuning.

Here’s what I did.

on max calls, what would you advice I do ?

Most people leave it unset. You’d only really set it to ensure that the system fails gracefully, when overloaded, by completely refusing calls, rather than getting into distress in mid call.

I have 24 cores machine. shall I tune it? if yes, what values would you advice?

also, please what is the maximum calls that I can terminate on my asterisk server?

here’s my lscpu output

:~# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 24
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 63
Model name: Intel(R) Xeon(R) CPU E7-4850 v3 @ 2.20GHz
Stepping: 4
CPU MHz: 2194.711
BogoMIPS: 4389.42
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 35840K
NUMA node0 CPU(s): 0-11
NUMA node1 CPU(s): 12-23
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single ssbd ibrs ibpb stibp kaiser fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid xsaveopt arat md_clear flush_l1d arch_capabilities

Again most people would leave it unset. I’d only consider setting it if I found evidence of running out of processor power.

Load average is the average number of threads that are either running on a CPU core or waiting to run on one, and it measured over three different time periods, one minute, 5 minutes and 15 minutes. I suspect Asterisk uses the one minute figure. One minute is still a very long time, in voice switching terms, so if you have other users of the machine, with peaky work loads, you may need a smaller limit than if the load was very even.

For an extremely even work load, anything up to the number of cores would be OK.

any idea?

You have to benchmark, as the processor load can vary by about two orders of magnitude, depending on what you are doing.

I see. thank you David

Also, on load average, asterisk may not be able to multi-thread well enough to use all the cores effectively, so may, for example show overloading by task process queue overflows, rather than high load averages.

I see.

here, you mentioned to find an equivalent. how exactly do you mean?

An option for MySQL that modifies the system limit on open file descriptors,for its process.

okay, I’ll do a research in that direction and will like to use your help if you can point me in the right direction.
however, i initially use ulimit descriptors 999999 but now that I have modified maxfiles from asterisk.conf, I’d see if it works.

I did some benchmarking with a raspberry pi 4 cores 8gb memory:

  • 50 concurrent calls while its not transcoding per cpu
  • 20 concurrent calls while transcoding per cpu

I got these results after watching this dude, which did the same. Its worth watching it if you need some sort of “avarage”

1 Like

This was great handy. Thank you @jeroenvip

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