ubuntu 系统修改打开文件数限制

原文:http://abloz.com/2011/01/25/the-modify-ubuntu-system-limits-the-number-of-open-files.html


linux缺省打开文件数限制在1024,这在服务器程序中显然太小,需进行修改。

直接用ulimit -n 65535,但重启后消失,新shell也没有修改。
如何修改打开文件数限制并重启后生效呢?

1.修改limits.conf
$ sudo vi /etc/security/limits.conf
在文件尾部增加
* hard nofile 65535
* soft nofile 65535
保存文件
注:*表示所有用户名。

你可能感兴趣的:(shell,ubuntu,服务器)