💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
$ ab -t 10 -c 200 'url' 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 tickets.2345.com (be patient) Completed 5000 requests Completed 10000 requests Completed 15000 requests Completed 20000 requests Completed 25000 requests Completed 30000 requests Finished 34664 requests Server Software: nginx [web服务器软件及版本] Server Hostname: tickets.2345.com [表示请求的URL中的主机部分名称] Server Port: 12345 [被测试的Web服务器的监听端口] Document Path: /tickets/m/help/getRootCategory?product=1&type=0 [ 请求的页面路径] Document Length: 298 bytes [页面大小] Concurrency Level: 200 [并发数] Time taken for tests: 10.000 seconds [测试总共花费的时间] Complete requests: 34664 [完成的请求数] Failed requests: 34136 [失败的请求数,这里的失败是指请求的连接服务器、发送数据、接收数据等环节发生异常,以及无响应后超时的情况。对于超时时间的设置可以用ab的-t参数。如果接受到的http响应数据的头信息中含有2xx以外的状态码,则会在测试结果显示另一个名为“Non-2xx responses”的统计项,用于统计这部分请求数,这些请求并不算是失败的请求。 只要出现Failed requests就会多一行数据来统计失败的原因,分别有Connect、Length、Exceptions。 Connect 无法送出要求、目标主机连接失败、要求的过程中被中断。 Length 响应的内容长度不一致 ( 以 Content-Length 头值为判断依据 )。 Exception 发生无法预期的错误。] (Connect: 0, Receive: 0, Length: 34136, Exceptions: 0) Write errors: 0 [ 写入错误] Non-2xx responses: 34136 Total transferred: 11432992 bytes [总共传输字节数,包含http的头信息等。使用ab的-v参数即可查看详细的http头信息。] HTML transferred: 5823920 bytes [html字节数,实际的页面传递字节数。也就是减去了Total transferred中http响应数据中头信息的长度。] Requests per second: 3466.37 [#/sec] (mean) [每秒处理的请求数,服务器的吞吐量] Time per request: 57.697 [ms] (mean) [用户平均请求等待时间] Time per request: 0.288 [ms] (mean, across all concurrent requests) [服务器平均处理时间] Transfer rate: 1116.49 [Kbytes/sec] received [平均传输速率(每秒收到的速率)。可以很好的说明服务器在处理能力达到限制时,其出口带宽的需求量。] Connection Times (ms) [压力测试时的连接处理时间。] min mean[+/-sd] median max Connect: 0 0 1.2 0 17 Processing: 7 53 276.4 20 2617 Waiting: 7 53 276.4 20 2617 Total: 9 53 276.7 20 2617 Percentage of the requests served within a certain time (ms) 50% 20 66% 21 75% 22 80% 23 90% 24 95% 27 98% 34 99% 2443 100% 2617 (longest request) 复制代码