个人技术分享

临时设置

ulimit -n 1025

查看是否成功

ulimit -n

永久设置,网上很多说添加* soft nofile 65535 * hard nofile 65535但设置后不生效

 vim /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535

然后重新连接或者重启服务(reboot)即可.

存在不生效原因:

limits.conf添加内容的格式

查看/etc/profile文件是否设置了全局变量如:

ulimit -n 65535类似数据