Redis服务器在使用Apache Bench进行基准测试时拒绝连接

时间:2019-03-21 10:41:20

标签: apache redis apache2 benchmarking

在安装了Apache和php的计算机上,redis中的数据很少。我正在使用php通过其api从redis获取数据。我必须测试来自APache2 Web服务器的Redis服务器响应时间。为此,我使用了ab即Apache Bench。以下是我在配置Apache2和Redis的同一系统上执行的命令。

ab -n 12000 -c 3000 -g andr_apache.csv http://10.10.12.129:8080/redis/read.php

然后是我们的

This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.11.21.129 (be patient)
Completed 1200 requests
Completed 2400 requests
Completed 3600 requests
Completed 4800 requests
Completed 6000 requests
Completed 7200 requests
Completed 8400 requests
Completed 9600 requests
Completed 10800 requests
apr_socket_recv: Connection reset by peer (104)
Total of 11701 requests completed

最后一个错误表明连接已重置。因此,以下是Apache2错误日志文件中的错误。

[Thu Mar 21 09:43:19.142446 2019] [php7:warn] [pid 22276] [client 10.11.21.141:38668] PHP Warning:  fsockopen(): unable to connect to 127.0.0.1:6379 (Cannot assign requested address) in /var/www/html/andr/redis/read.php on line 79
[Thu Mar 21 09:43:19.142453 2019] [php7:warn] [pid 22232] [client 10.11.21.141:38772] PHP Warning:  fsockopen(): unable to connect to 127.0.0.1:6379 (Cannot assign requested address) in /var/www/html/andr/redis/read.php on line 79

如果将请求数减少到3000,将用户数减少到3000以下,则作业成功完成,但是当我增加限制时,出现此错误。 Apache2和Reids中是否存在任何配置问题。我主要使用默认设置。 以下是成功运行的情节。为什么突然出现峰值。 enter image description here

0 个答案:

没有答案