Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu Apache基准测试错误:打开的文件太多_Ubuntu_Ubuntu 12.04_Apachebench_Ulimit - Fatal编程技术网

Ubuntu Apache基准测试错误:打开的文件太多

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

我正在使用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 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