Linux File descriptor limit

1. Find out what the current open file descriptor limit is.

 

$more /proc/sys/fs/file-max

753825

 or 

 

$sysctl -a | grep fs.file-max

fs.file-max = 753825

2. View how many open file descriptors are currently being used.

 

$more /proc/sys/fs/file-nr

4080    0       753825

3. Edit the kernel paramneter file /etc/sysctl.conf and add line “fs.file-max=[new value]” to it.

vi /etc/sysctl.conf

fs.file-max = 1000000

4. Apply the changes.

sysctl -p

fs.file-max = 331287

 

User Level FD Limits

The above procedure sets system-wide file descriptors (FD) limits. However, you can limit httpd (or any other users) user to specific limits by editing /etc/security/limits.conf file, enter:
# vi /etc/security/limits.conf
Set httpd user soft and hard limits as follows:
httpd soft nofile 4096
httpd hard nofile 10240

Save and close the file. To see limits, enter:
# su - httpd
$ ulimit -Hn
$ ulimit -Sn


http://www.cyberciti.biz/tips/linux-procfs-file-descriptors.html

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值