-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
centos中,报Too many open files in system错误。 #48
Comments
https://blog.csdn.net/wangjia55/article/details/80415818 |
需要配合linux参数了解错误原因。 csredis 设置连接池为多大? |
csredis 一定要设置成单例对象在项目中使用,不需要频繁 new CSRedisClient |
我没有配置连接池,我配置的链接字符串只是ip地址加端口号,如:127.0.0.1:6379,也没有频繁new CSRedisClient,我是按照你推荐的方式使用的。如下: |
CSRedisClient链接池不配置的话,默认50个。 访问量怎么样,redis-cli 观察 client list |
这个问题终归是系统资源不够用导致的 |
是的, 肯定是系统资源不够用导致的,但我open files在出现这个错误之前已经设置了10000了。而且,我那个应用秒级并发一般也就十几个。最大不会超过100个。 访问量大的问题可能不是很大。我这边会继续检查其他问题,如果您有时间的话,或者也可以试着再检查下csredis的代码。谢谢啦。 |
centos环境下有项目运行两年多,正常的。 如果允许最好升级csredis到最新版本。 |
redis-cli 观察 client list,看看有多少个链接 |
错误日志如下:
System.Net.Sockets.SocketException (23): Too many open files in system
at CSRedis.CSRedisClient.GetConnectionAndExecute[T](ConnectionPool pool, Func
2 handle) at CSRedis.CSRedisClient.ExecuteScalar[T](String key, Func
3 hander)at CSRedis.CSRedisClient.Get(String key)
at RedisHelper.Get(String key)
The text was updated successfully, but these errors were encountered: