ideawu / ssdb

SSDB - A fast NoSQL database, an alternative to Redis
http://ssdb.io/
BSD 3-Clause "New" or "Revised" License
8.17k stars 1.4k forks source link

CentOS6 too many open files 问题 #1068

Open Southeast opened 7 years ago

Southeast commented 7 years ago

进一步排查,因为我的client端网络非常不稳定,连接怀疑是死连接没有释放。lsof可以看到大量socket套接字

ssdb-serv 1657    root   63u     IPv4          367221455      0t0        TCP 7.93.159.94:7950->1.155.248.144:50024 (ESTABLISHED)
ssdb-serv 1657    root   64u     IPv4          571769194      0t0        TCP 7.93.159.94:7950->1.7.75.221:41337 (ESTABLISHED)
ssdb-serv 1657    root   65u     IPv4          571769197      0t0        TCP 7.93.159.94:7950->1.7.75.221:41356 (ESTABLISHED)

是否支持连接超时释放。类似redis配置:


# Close the connection after a client is idle for N seconds (0 to disable)
timeout 60

ideawu commented 7 years ago

文档中对这种情况有应对方案, 你先按文档解决, 如有问题, 对照的文档描述一下. 文档: http://ssdb.io/docs/zh_cn/config.html

Southeast commented 7 years ago

image 用文档的c1000k工具查过了,最大文件限制实际非常高,系统报“too many files open"错误的时候lsof只有4000个左右。 我们的server端会有许多不同ip的机器连接,但是连接后不能保证正常释放,需要server端去检测并释放过期连接

ideawu commented 7 years ago

log.txt 中 links: 12 类似的字样, 表示server端未释放的 fd.

huaxiaoer commented 5 years ago

image image 以上是用c1000K测试的结果和log中的记录。这个问题我们也遇到几次了,也是centos6。

perrornet commented 3 years ago

我同样遇到了这个问题。

系统版本

Linux iZwz9af6b264b13gqrjxg9Z 3.10.0-1127.18.2.el7.x86_64 #1 SMP Sun Jul 26 15:27:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

ssdb版本

image

file-max 设置值

image

open file设置值

image

ssdb打开的文件数量

image

ssdb连接数量

image

ssdb打开ldb文件数量

image

错误日志

image

ssdb占用资源情况

image

ideawu commented 3 years ago

@PerrorOne 你用的是什么linux发行版? 如果是 centos 7, 那么它比较特殊, 非常非常复杂, 你到网卡搜索一下教程, 或者找有经验的人士帮忙.