centos7修改最大文件打開數量


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

然后保存。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM