Increase File Descriptor Limit on Linux
If Brekeke PBX is running on Linux system, you need to increase file descriptor limit to a number greater than the number of ports used by Brekeke PBX.
Default port ranges set in Brekeke PBX and bundled SIP Server are
For v3.x Brekeke PBX:
- SIP Server: 10000 – 29999
- PBX: 30000 – 49999
- Media server: 50000 – 59999
Total number of default ports needed by Brekeke PBX is 50000.
You need to increase the limit of Linux file descriptor to the number more than the ports needed by Brekeke PBX.
If you change the port range at Brekeke PBX, you need to configure the limit of file descriptor at OS with the following instructions.
How to check file descriptor limit of user on Linux
# ulimit -n
How to check file descriptor limit of running java processes on Linux
1. Check processID (PID) of running java processes with the following command.
# ps -eaf | grep java | grep -v grep | awk '{print $1,$2,$3,$4,$5,$6,$7,$8}'
# ps -eaf | grep java | grep -v grep | awk '{print $1,$2,$3,$4,$5,$6,$7,$8}' root 3699 1 0 Sep01 ? 03:44:38 /opt/jdk1.8.0_91/bin/java root 3731 3699 0 Sep01 ? 00:14:07 /opt/jdk1.8.0_91/jre/bin/java root 3828 3699 0 Sep01 ? 00:13:51 /opt/jdk1.8.0_91/jre/bin/java root 3871 3699 0 Sep01 ? 00:36:53 /opt/jdk1.8.0_91/jre/bin/java root 3916 3699 0 Sep01 ? 00:19:51 /opt/jdk1.8.0_91/jre/bin/java
The value of 2nd field from left is PID of each process.
2.Check file descriptor limit of each above process with the following command.
# cat /proc/<PID>/limits
# cat /proc/3699/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 10485760 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 29715 29715 processes
Max open files 50240 50240 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 29715 29715 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
3. Repeat no.2 for all PIDs.
How to increase file descriptor limit on Linux
1. Open and edit /etc/security/limits.conf
2. Change the number in the following lines to a larger number, such as
* soft nofile 50240 * hard nofile 50240
3. restart pc.