美文网首页
关于报错 too many open files

关于报错 too many open files

作者: 吃豆腐不吐豆腐皮 | 来源:发表于2024-05-06 15:43 被阅读0次

压测游戏服务器的时候,发现好几个服务 socket 提示 too many open files ,并且加载文件读取数据库都失败。估计是 fd 上限设置的太小了。
使用 ulimit -a 检查,看到 open files 的值才1024。果然。
修改方法如下,在文件/etc/security/limits.conf 的最后添加

*         hard    nofile      500000
*         soft    nofile      500000
root      hard    nofile      500000
root      soft    nofile      500000

参考 https://www.baeldung.com/linux/error-too-many-open-files#file-descriptor-limits

相关文章

网友评论

      本文标题:关于报错 too many open files

      本文链接:https://www.haomeiwen.com/subject/jlblfjtx.html