Too many open files in system~

第一次遇到这个问题的时候,只是简单的认为开的file 太多了 ,就让程序睡眠了,虽然很笨,也算是解决了。

第一次遇到这个问题的时候,根本就没有读写任何file,只是读写数据库。才知道connection 太多也会这样。

切换到oracle的时候出错:
[root@test ~]# su - oracle
su: /bin/bash: Too many open files in system
[root@test ~]#



下面只说解决成功的过程
[root@test ~]# cat /proc/sys/fs/file-max
512
[root@test ~]#

发现文件限制数太少

查看/etc/sysctl.conf发现:

fs.file-max = 512 * PROCESSES

这个直接按照oracle的安装说明复制粘贴上去了,没有改动,修改为:

kernel.sem=1055 32000 100 128
kernel.shmmax=2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000


运行:
[root@test ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.sem = 1055 32000 100 128
kernel.shmmax = 2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
[root@test ~]# cat /proc/sys/fs/file-max
6553600
[root@test ~]#


然后就可以切换过去了


还有一种方法,
echo "10240" >/proc/sys/fs/file-max
重启后就失效了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值