首页   注册   登录

whoami9894

V2EX 第 282705 号会员,加入于 2018-01-14 22:48:12 +08:00
Junior student majoring in information security
请教一下 ab 压测
问与答  •  whoami9894  •  18 天前  •  最后回复来自 whoami9894
18
Windows 补丁 KB4517389 微软是不打算解决了吗
问与答  •  whoami9894  •  22 天前  •  最后回复来自 whoami9894
7
XHR 跨域问题
问与答  •  whoami9894  •  32 天前  •  最后回复来自 sanmaozhao
4
微信小程序签到接口鉴权问题
微信  •  whoami9894  •  39 天前  •  最后回复来自 also24
7
吐槽 windows terminal 的窒息操作
Windows  •  whoami9894  •  64 天前  •  最后回复来自 whoami9894
9
实在受不了 VScode 写 Go 的体验了, GoLand 真香
Go  •  whoami9894  •  31 天前  •  最后回复来自 szzhiyang
79
学校的虚拟主机跑着跑着磁盘崩了
Linux  •  whoami9894  •  97 天前  •  最后回复来自 ps1aniuge
10
GO 的这种情况下该如何使用类型断言
问与答  •  whoami9894  •  101 天前  •  最后回复来自 whoami9894
16
WindowsTerminal 如何快捷启动
问与答  •  whoami9894  •  116 天前  •  最后回复来自 whoami9894
2
whoami9894 最近回复了
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@ClericPy
学到了,感谢感谢
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@ClericPy
Time per request: 1311.422 [ms] (mean)
Time per request: 1.311 [ms] (mean, across all concurrent requests)
我搜了下超过 1s 应该是 1000 并发量都请求一次的时间,平均下来一个请求 1ms 左右,应该差不多
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@chenset 果然是,改成 2^16-1 感觉没啥问题了

```
Concurrency Level: 1000
Time taken for tests: 13.114 seconds
Complete requests: 10000
Failed requests: 421
(Connect: 0, Receive: 0, Length: 421, Exceptions: 0)
Total transferred: 24437163 bytes
HTML transferred: 20628743 bytes
Requests per second: 762.53 [#/sec] (mean)
Time per request: 1311.422 [ms] (mean)
Time per request: 1.311 [ms] (mean, across all concurrent requests)
Transfer rate: 1819.74 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 188 724 226.3 670 2185
Processing: 118 540 146.4 538 1997
Waiting: 22 232 137.8 188 1775
Total: 465 1265 265.6 1234 2689

Percentage of the requests served within a certain time (ms)
50% 1234
66% 1315
75% 1370
80% 1409
90% 1538
95% 1703
98% 2100
99% 2193
100% 2689 (longest request)
```
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@phpdever
`-c 1000 -n 3000`时的负载情况

```
top - 13:30:23 up 51 days, 16:50, 2 users, load average: 1.67, 0.46, 0.18
任务: 269 total, 3 running, 197 sleeping, 0 stopped, 0 zombie
%Cpu(s): 72.1 us, 7.5 sy, 0.0 ni, 18.5 id, 0.0 wa, 0.0 hi, 1.9 si, 0.0 st
KiB Mem : 16422300 total, 1691276 free, 1062368 used, 13668656 buff/cache
KiB Swap: 2097148 total, 2097148 free, 0 used. 15068552 avail Mem

进 USER PR NI VIRT RES SHR %CPU %MEM TIME+ COMMAND 22322 root 20 0 120432 72864 11844 R 496.3 0.4 5:00.33 main
11740 root 20 0 115144 75736 5228 R 98.7 0.5 0:04.26 ab
4207 mysql 20 0 4790288 291612 15756 S 44.9 1.8 31:01.26 mysqld
```


```
Concurrency Level: 1000
Time taken for tests: 4.461 seconds
Complete requests: 3000
Failed requests: 2677
(Connect: 0, Receive: 0, Length: 2677, Exceptions: 0)
Total transferred: 6918669 bytes
HTML transferred: 5772209 bytes
Requests per second: 672.43 [#/sec] (mean)
Time per request: 1487.146 [ms] (mean)
Time per request: 1.487 [ms] (mean, across all concurrent requests)
Transfer rate: 1514.42 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 156 753 286.5 689 1852
Processing: 57 517 166.8 534 1167
Waiting: 9 243 132.5 208 904
Total: 326 1271 353.3 1284 2457

Percentage of the requests served within a certain time (ms)
50% 1284
66% 1355
75% 1384
80% 1481
90% 1696
95% 1965
98% 2169
99% 2209
100% 2457 (longest request)
```
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@lbp0200
这是`-c 20 -n 1000`的结果

```
Concurrency Level: 20
Time taken for tests: 1.383 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 2532000 bytes
HTML transferred: 2152000 bytes
Requests per second: 723.07 [#/sec] (mean)
Time per request: 27.660 [ms] (mean)
Time per request: 1.383 [ms] (mean, across all concurrent requests)
Transfer rate: 1787.92 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 7 19 5.4 18 39
Processing: 2 8 3.9 8 27
Waiting: 1 6 3.3 5 25
Total: 10 27 6.3 27 54

Percentage of the requests served within a certain time (ms)
50% 27
66% 29
75% 30
80% 31
90% 36
95% 40
98% 45
99% 46
100% 54 (longest request)
```
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@Flasky 不求能抗住抢课那个并发量 2333。我们教务系统每逢抢课必挂,抢课脚本得在抢课开始前维护一个 TCP 连接池
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@ClericPy 这个接口逻辑就是从 session 里取用户名,然后 SELECT 一次数据库,这样测试我怀疑数据库缓存也有加成

我换成`-n 3000 -c 1000`结果是这样,fail 还是过多

```
Concurrency Level: 1000
Time taken for tests: 5.023 seconds
Complete requests: 3000
Failed requests: 2421
(Connect: 0, Receive: 0, Length: 2421, Exceptions: 0)
Total transferred: 6381837 bytes
HTML transferred: 5230257 bytes
Requests per second: 597.29 [#/sec] (mean)
Time per request: 1674.237 [ms] (mean)
Time per request: 1.674 [ms] (mean, across all concurrent requests)
Transfer rate: 1240.82 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 380 807 255.4 738 1678
Processing: 151 518 156.7 480 1094
Waiting: 28 264 151.7 223 830
Total: 594 1325 242.7 1277 2621

Percentage of the requests served within a certain time (ms)
50% 1277
66% 1387
75% 1457
80% 1531
90% 1642
95% 1769
98% 1994
99% 2087
100% 2621 (longest request)
```
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@richangfan 你不说我还没注意到 90%请求都失败了.......
18 天前
回复了 whoami9894 创建的主题 问与答 请教一下 ab 压测
@chenset 其实我不太理解的是 rps 700 是个什么级别,假如说 2000 人同时请求的话会不会就挂了
HTML 由 js 动态生成的,还做了混淆
关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   2406 人在线   最高记录 5043   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.3 · 19ms · UTC 03:49 · PVG 11:49 · LAX 19:49 · JFK 22:49
♥ Do have faith in what you're doing.