Ubuntu Apache基准测试错误:打开的文件太多
我正在使用apache基准测试我的localhost网站,但出现以下错误:Ubuntu Apache基准测试错误:打开的文件太多,ubuntu,ubuntu-12.04,apachebench,ulimit,Ubuntu,Ubuntu 12.04,Apachebench,Ulimit,我正在使用apache基准测试我的localhost网站,但出现以下错误: uday@uday-VirtualBox:/$ ab -n 2000 -c 2000 http://localhost/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The A
uday@uday-VirtualBox:/$ ab -n 2000 -c 2000 http://localhost/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
socket: Too many open files (24)
我不知道还能做什么我真的想让它工作我的系统RAM是5GB。你可以将文件描述符设置得很高。我总是通过以下方式完成: /etc/安全/限制。d:
# set a high rate of file descriptors.
# for api and high traffic, high connection rate server.
# Setting for all users because if a user restarts the server,
# the process of the server has the same value the user had as nofile.
#
* - nofile 250000
在这之后,您需要完全重新启动,因为这些设置将被shell刷新。
注意这个设置。通常,您需要对其进行更严格的配置。但在这种情况下,您似乎只是在虚拟机上使用它进行测试。您是针对apache还是nginx进行测试?
# set a high rate of file descriptors.
# for api and high traffic, high connection rate server.
# Setting for all users because if a user restarts the server,
# the process of the server has the same value the user had as nofile.
#
* - nofile 250000