Skip to content
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

linux 里ulimit永久生效设置(debian9 64) #28

Open
thm7x opened this issue Jul 3, 2019 · 0 comments
Open

linux 里ulimit永久生效设置(debian9 64) #28

thm7x opened this issue Jul 3, 2019 · 0 comments

Comments

@thm7x
Copy link
Owner

thm7x commented Jul 3, 2019

最近在使用wrk做接口压力测试时,-c 参数超过1024时就会报错:Too many open files
一顿求证,就有了下面的解决方法,调大系统默认的ulimit值即可。

同一时间系统允许用户开启最大进程数量和最大可打开文件链接句柄数

1.1 查看

#查看ulimit情况
$ ulimit -a
#同一时间用户可开启的最大进程数
$ ulimit -u 
#同一时间用户可打开的最大文件数
$ ulimit -n

1.2 编辑 /etc/security/limits.conf 追加如下配置内容,允许最大值:6553665565

* soft nofile 65536      # open files  (-n)
* hard nofile 65536

* soft nproc 65565
* hard nproc 65565       # max user processes   (-u)

1.3 永久生效

本机:注销系统重新登录。

远端服务器:退出ssh终端重新链接即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant