mac os 下 不能用 ab 做压力测试
发布于 12 年前 作者 xian366 25304 次浏览 最后一次编辑是 8 年前

<p>比如: 用 nodejs listen 8888 端口</p>

<p>用ab做测试。</p>

<blockquote> <p>wx@wx:~/Sites/nodejs$ab -n 1000 -c 10 http://localhost:8888/</p>

<p>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/</p>

<p>Benchmarking localhost (be patient) <strong>apr<em>socket</em>recv: Connection refused (61)</strong></p> </blockquote>

<p>这是什么问题?</p>

16 回复

上代码么?

就是普通的hello world 都不行。

var http = require(‘http’); http.createServer(function (req, res) { res.writeHead(200, {‘Content-Type’: ‘text/plain’}); res.end(‘Hello World\n’); }).listen(8888);

不好意思格式乱了。

var http = require(‘http’); http.createServer(function (req, res) { res.writeHead(200, {‘Content-Type’: ‘text/plain’}); res.end(‘Hello World\n’); }).listen(8888);

普通的hello world 都不行。

执行: ab -n 10 -c 1 http://127.0.0.1:8888/view

还是报错,如下:

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 127.0.0.1 (be patient)…Send request failed! Send request failed! apr_socket_recv: Connection reset by peer (54) Total of 3 requests completed

有开启防火墙么?或者试试telnet 127.0.0.1 8888 看能不能连接上去

ab在我mac一直无法跑成功,我换http_load了

ok 我试试;

发现了一个新的测试工具;webbench

这个比较简单。

Mac下的压力测试不可靠啊~跳动太大了,根本不准。

simple and reliable,哦去,你也在百度待过?

我觉得也是,ab每次差别幅度很大,不过我最近发现pylot还比较轻便。

晕,搜索问题搜到你发的了。。。 我也ab同问题了。。。

回到顶部