[Kernel/Drive] /etc/security/limits.conf 改动后,重新登录不起作用
Tofloor
poster avatar
coder潘
deepin
2025-02-18 19:11
Author
* soft nofile 10485760
* hard nofile 10485760
# 或者
xxx soft nofile 10485760
xxx hard nofile 10485760

试了以上两种都不行,论坛没有人遇到这个问题吗,你们是如何增加 当前进程最大open file量?

Reply Favorite View the author
All Replies
MeGusta
deepin
2025-02-18 20:30
#1

在stackexchange上面查询到,获取系统nofile最大值的命令:

python3 -c "import resource; print(resource.getrlimit(resource.RLIMIT_NOFILE))"

我返回的是(1024, 1048576),你设置的值 10485760是不是超限了。

Reply View the author
观摩
deepin
2025-02-18 20:48
#2

二楼可能是正解。

cat >  /etc/security/limits.d/nofile.conf << "EOF"
*       soft    nproc   1048576
*       hard    nproc   1048576
root    soft    nproc   unlimited
*       soft    nofile  1048576
*       hard    nofile  1048576
root    soft    nofile  unlimited
EOF
Reply View the author
coder潘
deepin
2025-02-19 10:22
#3

试过了,1048576也不行

可能今年我就退回win11 了。。

Reply View the author
MeGusta
deepin
2025-02-19 10:55
#4
coder潘

试过了,1048576也不行

可能今年我就退回win11 了。。

image.png

image.png

好像sn最大是1024,hn最大是1048576。

Reply View the author