php网站开发小程序,用别人网站名做长尾关键词,兴远建设网站,免费自助建站排名http压力测试工具及使用说明 转 说明#xff1a;介绍几款简单、易使用http压测工具#xff0c;便于研发同学#xff0c;压测服务#xff0c;明确服务临界值#xff0c;寻找服务瓶颈点。 压测时候可重点以下指标#xff0c;关注并发用户数、TPS#xff08;每秒事务数量介绍几款简单、易使用http压测工具便于研发同学压测服务明确服务临界值寻找服务瓶颈点。 压测时候可重点以下指标关注并发用户数、TPS每秒事务数量、RT事务响应时间、事物失败率、CPU不要超过70%、LOAD4核以下服务不要超过2 http_loadApache BenchApache自带服务器压力测试工具webbench http_load 以并行复用的方式运行以测试web服务器的吞吐量与负载。不同于大多数压力测试工具它是单进程所以一般不会把客户机搞死也可以测试https类网站的请求。 支持多个url。 官方网站 wget http://acme.com/software/http_load/http_load-14aug2014.tar.gz tar zxvf http_load-14aug2014.tar.gz ln -s http_load-14aug2014 http_load cd http_load make make install ➜ /Users/yxy/data/soft/http_load http_load --help usage: http_load [-checksum] [-throttle] [-proxy host:port] [-verbose] [-timeout secs] [-sip sip_file] -parallel N | -rate N [-jitter] -fetches N | -seconds N url_file One start specifier, either -parallel or -rate, is required. One end specifier, either -fetches or -seconds, is required. 参数简单说明 -parallel 简写-p并发的用户数 -rate 简写-r每秒访问次数 -fetches 简写-f总计访问次数 -seconds 简写-s持续访问时间 url_file 压测url文件形式需要访问的url支持多个每行一个 执行实例 ➜ /Users/yxy/data/soft/http_load http_load -p 10 -s 10 urls #10个并发用户连续不停访问10s 182 fetches, 10 max parallel, 1.03449e06 bytes, in 10.0038 seconds --182次访问最大并发数是10总计传输数据1.03449e06字节运行时间10秒 5684 mean bytes/connection 18.1932 fetches/sec, 103410 bytes/sec --每秒的响应请求18.1932每秒传递的数据为103410字节 msecs/connect: 24.8529 mean, 1048.38 max, 4.062 min --连接平均响应时间是24.85毫秒最大响应时间1048毫秒最小响应时间4毫秒 msecs/first-response: 483.459 mean, 683.458 max, 164.157 min --每次连接平均返回时间 平均最大最小 HTTP response codes: code 200 -- 182 Apache BenchApache自带服务器压力测试工具 ➜ /Users/yxy ab -c 10 -n 50 http://192.168.100.152:18800/casefolder-social/question/detail?shareUID40d0c000-09b6-416c-b626-b9ce61399d07 -- -n 表示每次请求数默认不能超过1024个-c表示1个请求的并发连接数默认最大不能超过50000。 -- 模拟50个并发连接每次以100个请求数来测试网站的Web性能 This is ApacheBench, Version 2.3 $Revision: 1663405 $ Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.100.152 (be patient).....done Server Software: Apache-Coyote/1.1 Server Hostname: 192.168.100.152 Server Port: 18800 Document Path: /casefolder-social/question/detail?shareUID40d0c000-09b6-416c-b626-b9ce61399d07 Document Length: 641 bytes Concurrency Level: 10 Time taken for tests: 0.703 seconds Complete requests: 50 Failed requests: 0 Total transferred: 39100 bytes HTML transferred: 32050 bytes Requests per second: 71.16 [#/sec] (mean) Time per request: 140.532 [ms] (mean) Time per request: 14.053 [ms] (mean, across all concurrent requests) Transfer rate: 54.34 [Kbytes/sec] received Connection Times (ms) min mean[/-sd] median max Connect: 6 21 26.4 13 102 Processing: 87 114 50.9 107 460 Waiting: 84 114 51.0 106 459 Total: 100 136 58.2 119 473 Percentage of the requests served within a certain time (ms) 50% 119 66% 126 75% 131 80% 132 90% 217 95% 223 98% 473 99% 473 100% 473 (longest request) webbench 使用方式和http_load相似指标较为简单 webbench是Linux下的一个网站压力测试工具最多可以模拟3万个并发连接去测试网站的负载能力。下载地址http://soft.vpser.net/test/webbench/webbench-1.5.tar.gz安装非常简单 #tar zxvf webbench-1.5.tar.gz #cd webbench-1.5 #make make install 会在当前目录生成webbench可执行文件直接可以使用了 用法webbench -c 并发数 -t 运行测试时间 URL 例如 /Users/yxy/data/soft/webbench webbench -c 10 -t 30 http://192.168.100.152:18800/casefolder-social/question/detail\?shareUID\40d0c000-09b6-416c-b626-b9ce61399d07 Webbench - Simple Web Benchmark 1.5 Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software. Benchmarking: GET http://192.168.100.152:18800/casefolder-social/question/detail?shareUID40d0c000-09b6-416c-b626-b9ce61399d07 10 clients, running 30 sec. Speed3958 pages/min, 51585 bytes/sec. Requests: 1979 susceed, 0 failed. 转载于:https://www.cnblogs.com/heqiyoujing/p/9432105.html