centos7修改最大文件打开数量

Posted on   风行天下-2080  阅读(1243)  评论(0编辑  收藏  举报

1、

https://blog.argcv.com/articles/3212.c

若该用户是普通用户

1
2
$ ulimit -n 65535
-bash: ulimit: open files: cannot modify limit: Operation not permitted

若你用 root 当然可以, 但你真的想用 root 跑 db 么?

正确的打开方式其实应该是修改 limit.

打开 /etc/security/limits.conf, 添加内容如下:

/etc/security/limits.conf
1
2
your_user_name           soft    nofile          65535
your_user_name           hard    nofile          65535

或者若想要一加一个组

/etc/security/limits.conf
1
2
@your_group_name           soft    nofile          65535
@your_group_name           hard    nofile          65535

然后保存。

编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?

随笔 - 618, 文章 - 0, 评论 - 6, 阅读 - 37万

Copyright © 2025 风行天下-2080
Powered by .NET 9.0 on Kubernetes

点击右上角即可分享
微信分享提示