測試php項目的并發(fā)
環(huán)境:
php版本:php7.4
系統(tǒng)版本:Centos7 / Nginx 1.20
程序: Think5.1做的一個網站
文章來源地址http://www.zghlxwxcb.cn/article/165.html
開始
1、安裝壓力測試工具ab
yum install httpd-tools -y
2、測試命令
ab -n 200 -c 2 http://測試網址/ //-n總的請求次數(shù) //-c并發(fā)請求數(shù) //-k是否開啟長連接
3、參數(shù)詳解
Benchmarking 測試網址 (be patient) Completed 100 requests Completed 200 requests Finished 200 requests #服務器軟件名稱及版本信息 Server Software: nginx #服務器主機名 Server Hostname: 測試網址 #服務器端口 Server Port: 80 #供測試的URL路徑 Document Path: / #供測試的URL返回的文檔大小 Document Length: 29167 bytes #并發(fā)數(shù) Concurrency Level: 2 #壓力測試消耗的總時間 Time taken for tests: 12.726 seconds #壓力測試的的總次數(shù) Complete requests: 200 #失敗的請求數(shù) Failed requests: 178 (Connect: 0, Receive: 0, Length: 178, Exceptions: 0) #傳輸?shù)目倲?shù)據(jù)量 Total transferred: 5864178 bytes #HTML文檔的總數(shù)據(jù)量 HTML transferred: 5833578 bytes #平均每秒的請求數(shù) Requests per second: 15.72 [#/sec] (mean) #所有并發(fā)用戶(這里是100)都請求一次的平均時間 Time per request: 127.261 [ms] (mean) #單個用戶請求一次的平均時間 Time per request: 63.630 [ms] (mean, across all concurrent requests) #傳輸速率,單位:KB/s Transfer rate: 450.00 [Kbytes/sec] received #連接時間 Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.4 0 1 Processing: 89 120 88.5 111 1350 Waiting: 89 119 88.4 110 1348 Total: 89 120 88.6 111 1351 #特定時間內服務的請求百分比(毫秒) Percentage of the requests served within a certain time (ms) 50% 111 66% 115 75% 119 80% 123 90% 132 95% 145 98% 162 99% 165 100% 1351 (longest request)
文章來源:http://www.zghlxwxcb.cn/article/165.html
到此這篇關于如何測試php項目的并發(fā),php項目壓力測試,壓力測試結果分享的文章就介紹到這了,更多相關內容可以在右上角搜索或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!