跳到主要内容
CNode

mac os 下 不能用 ab 做压力测试

社区
Xxian366发布于 15 年前最后回复 12 年前
16270490

比如: 用 nodejs listen 8888 端口

用ab做测试。

wx[@wx](/user/wx):~/Sites/nodejs$ab -n 1000 -c 10 http://localhost:8888/

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) aprsocketrecv: Connection refused (61)

这是什么问题?

查看回复

回复 (16)

C
changboter#1513 年前

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

M
mackjoner#1414 年前

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

S
sumory#1314 年前
引用 qingdusiege: http://www.joedog.org/siege home/ 简单可依赖

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

J
JacksonTian#1214 年前

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

Q
qingdu#1115 年前

siege: http://www.joedog.org/siege-home/ 简单可依赖

X
xian366#1015 年前

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

这个比较简单。

F
fengmk2#815 年前

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

L
leizongmin#715 年前
引用 leizongmin上代码么?

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

X
xian366#615 年前
引用 xqunixab 的一个bug,使用 127.0.0.1 代替 localhost 就行了,参见: http://stackoverflow.com/questions/7938869/ab is err...

执行: 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

X
xqunix#515 年前

ab 的一个bug,使用 127.0.0.1 代替 localhost 就行了,参见: http://stackoverflow.com/questions/7938869/ab-is-erroring-out-with-apr-socket-recv-connection-refused-61

X
xian366#415 年前

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 都不行。

X
xian366#315 年前
引用 leizongmin上代码么?

不好意思格式乱了。

X
xian366#215 年前
引用 leizongmin上代码么?

就是普通的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);

L
leizongmin#115 年前

上代码么?

参与回复

登录后即可参与回复。登录