简体   繁体   English

如何增加在 Ubuntu 上运行的 Asterisk 的打开文件描述符

[英]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.

相关问题 查看“打开文件描述符” - View “open file descriptors” 如何在Ubuntu中增加Neo4j的最大文件打开限制(ulimit)? - How to increase Neo4j's maximum file open limit (ulimit) in Ubuntu? 如何在Ubuntu中增加RabbitMQ文件描述符限制 - How to increase RabbitMQ file descripter limit in Ubuntu Ubuntu 18.04 上 Docker 的 Elasticsearch 文件描述符错误 - Elasticsearch file descriptors error with Docker on Ubuntu 18.04 如何在 Ubuntu 中打开 .accdb 文件? - How to open an .accdb file in Ubuntu? 尝试在具有Asterisk 13.16的Ubuntu 16.04上安装freepbx 14-错误:无法与星号通信,星号似乎正在以星号运行 - Trying to install freepbx 14 on Ubuntu 16.04 with Asterisk 13.16 - Error: can't communicate with asterisk, asterisk appears to be running as asterisk 增加Ubuntu / Upstart的最大打开文件(initctl) - Increase max open files for Ubuntu/Upstart (initctl) 限制进程在其生命周期内可以打开的文件描述符的数量 - Limit the number of file descriptors a process can open over its lifespan 为什么打开的文件描述符没有被重用,而是在数值上增加 - why open file descriptors are not getting reused instead they are increasing in number value 在ubuntu中运行脚本文件 - running script file in ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM