apaceh httpd-tools 压力测试 (ab工具)

来源:互联网 发布:淘宝充值平台 退款 编辑:程序博客网 时间:2024/04/29 09:56

/ab -kc 1000 -n 1000000 http://10.10.11.11/index.html



注意,代码apache的源码需要修改一下~/httpd-2.4.6/support/ab.c 


elseif (status != APR_SUCCESS) {
1360             err_recv++;
1361             if(recverrok) {
1362                 bad++;
1363                 close_connection(c);
1364                 if(verbosity >= 1) {
1365                     charbuf[120];
1366                     fprintf(stderr,"%s: %s (%d)\n""apr_socket_recv", apr_strerror(status, buf, sizeofbuf), status);
1367                 }
1368                 return;
1369             } else{
1370                 bad++;                                 //添加
1371                 close_connection(c);                   //添加
1372                 //apr_err("apr_socket_recv", status);  //注释
1373             }
1374         }