ab测压

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Lg632/article/details/88840521

ab测压:

yum -y install httpd-tools

ab -V

-n 即requests,用于指定压力测试总共的执行次数。缺省是1;

-c 即concurrency,用于指定的并发数。缺省是1;

-t:测试所进行的总时间,秒为单位,缺省50000s

-k 启用HTTP KeepAlive功能,即在一个HTTP会话中执行多个请求。默认时,不启用KeepAlive功能。

-t 即timelimit,等待响应的最大时间(单位:秒),其内部隐含值是-n 50000,它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。

-p:POST时的数据文件

-w: 以HTML表的格式输出结果

执行测试用例:ab -n 1000 -c 100 -w http://localhost/index.php >>d:miss.html


性能测试:

swoole、nginx、Golang web 性能比较100 个并发,100万http请求基准测试
swoole、swoole (mysql 线程池)、nginx + fastCGI + php QPS性能比较
#swoole、nginx、Golang  web 性能比较
# nginx helloworld 测试
ab -c 100 -n 1000000 -k http://127.0.0.1:9508/
# golang hello,world 测试
ab -c 100 -n 1000000 -k http://127.0.0.1:8080/
# swoole helloworld 测试
php http-server.php > /dev/null 2>&1
ab -c 100 -n 1000000 -k http://127.0.0.1:9505/

#swoole、swoole (mysql 线程池)、nginx + fastCGI + php

#swoole 同步mysql
php swoole-mysql.php > /dev/null 2>&1
ab -c 2000 -n 20000 http://192.168.132.128:9502/

#swoole mysql 线程池
php swoole-mysql-pool.php > /dev/null 2>&1
ab -c 2000 -n 20000 http://192.168.132.128:9501/
#nginx + fastCGI
ab -c 2000 -n 20000 http://192.168.132.128:9508/pool/sync-mysql.php

同类型的压力测试工具还有: webbench、siege、http_load 等

猜你喜欢

转载自blog.csdn.net/Lg632/article/details/88840521
今日推荐