[英]How to increase open file descriptors for Asterisk running on Ubuntu
I ran in to this and I found only one other post on this is had the fix but it wasn't that clear and a couple years old.我遇到了这个,我发现只有一篇关于这个的帖子有修复,但不是那么清楚,而且已经有几年了。
Ubuntu 20.04 Asterisk 16.9 Ubuntu 20.04 星号 16.9
Error Message:错误信息:
[Jul 20 21:37:16] WARNING[1742] alertpipe.c: Failed to create alert pipe with eventfd(), falling back to pipe(): Too many open files
[Jul 20 21:37:16] WARNING[1742] alertpipe.c: Failed to create alert pipe: Too many open files
Asterisk PID: 1130星号 PID:1130
Check the limits for the process.检查进程的限制。 Max open file soft limit is 1024
最大打开文件软限制为 1024
root@trueringless-asterisk:/home/esundberg# cat /proc/1130/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 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 64057 64057 processes
Max open files 1024 4096 files
Max locked memory 16777216 16777216 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 64057 64057 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
edit /etc/asterisk/asterisk.conf编辑 /etc/asterisk/asterisk.conf
[options]
maxfiles = 4096 ; Maximum amount of openfiles.
Stop the asterisk process停止星号进程
# systemctl stop asterisk
Make sure asterisk is stopped确保星号已停止
# ps -ef | grep asterisk
Start the asterisk process启动星号进程
# systemctl start asterisk
Get the New asterisk PID获取新的星号 PID
# ps -ef | grep asterisk
root 4925* 1 16 05:07 ? 00:00:00 /usr/sbin/asterisk
Check the file limits they are now at 4096 for the process检查他们现在在 4096 的文件限制的进程
# cat /proc/4925/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 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 64057 64057 processes
Max open files 4096 4096 files
Max locked memory 16777216 16777216 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 64057 64057 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
The simplest solution is just to rewrite systemd or init.d script you are using for start asterisk or /usr/sbin/safe_asterisk.sh script.最简单的解决方案是重写您用于启动星号或 /usr/sbin/safe_asterisk.sh 脚本的 systemd 或 init.d 脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.