linux之加大服务器文件描述符

来源:互联网 发布:二手船用雷达淘宝网 编辑:程序博客网 时间:2024/05/19 07:25

1.ulimit

[root@cs70-moban ~]# ulimit -n
1024

2.开机自启动的两种设置方式

2.1

[root@cs70-moban ~]# echo '* - nofile 65535'>>/etc//security/limits.conf 
[root@cs70-moban ~]# ulimit -n
1024
[root@cs70-moban ~]# logout
Last login: Thu May 11 13:24:53 2017 from 192.168.232.1
-bash: ~]#: command not found
[root@cs70-moban ~]# ulimit -n
65535
[root@cs70-moban ~]# 

2.2

[root@cs70-moban ~]# cat >> /etc/rc.local <<EOF 
> ulimit -HSn 65535
> ulimit -s 65535
> EOF

注意:

ulimit:调整可用shell和进程资源限制

     -n查看文件描述符最大数量

             -H硬设

            -S软设

         

0 0
原创粉丝点击