簡體   English   中英

為什么 Clinic.js 和 Autocannon 返回 0 個 2xx 響應,36164 個非 2xx 響應?

[英]Why are clinic.js and Autocannon returning 0 2xx responses, 36164 non 2xx responses?

我有一個 nodejs 網絡服務,我想使用 Clinic.js 來分析它的性能並找到瓶頸。

所以當我發出這個命令時:

clinic doctor --on-port 'autocannon localhost:$PORT --connections 5 -m "POST" -i my-data.json -H "Authorization":"Bearer xxx" ' -- node ./dist/custom/index.js

我得到下一個日志:

Running 10s test @ http://localhost:443
5 connections

┌─────────┬──────┬──────┬───────┬──────┬──────┬───────┬──────┐
│ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg  │ Stdev │ Max  │
├─────────┼──────┼──────┼───────┼──────┼──────┼───────┼──────┤
│ Latency │ 0 ms │ 0 ms │ 0 ms  │ 0 ms │ 0 ms │ 0 ms  │ 0 ms │
└─────────┴──────┴──────┴───────┴──────┴──────┴───────┴──────┘
┌───────────┬─────┬──────┬─────┬───────┬─────┬───────┬─────┐
│ Stat      │ 1%  │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │
├───────────┼─────┼──────┼─────┼───────┼─────┼───────┼─────┤
│ Req/Sec   │ 0   │ 0    │ 0   │ 0     │ 0   │ 0     │ 0   │
├───────────┼─────┼──────┼─────┼───────┼─────┼───────┼─────┤
│ Bytes/Sec │ 0 B │ 0 B  │ 0 B │ 0 B   │ 0 B │ 0 B   │ 0 B │
└───────────┴─────┴──────┴─────┴───────┴─────┴───────┴─────┘

Req/Bytes counts sampled once per second.

63k requests in 11.01s, 0 B read
63k errors (0 timeouts)
USMCDANCN2Z76AB:172542_alexa_skills_template xzxqdy$ clinic doctor --on-port 'autocannon localhost:$PORT --connections 5 -m "POST" -i my-data.json -H "Authorization":"Bearer xxx" ' -- node ./dist/custom/index.js
Running 10s test @ http://localhost:443
5 connections

running [                    ] 0%
┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬───────┐
│ Stat    │ 2.5% │ 50%  │ 97.5% │ 99%  │ Avg     │ Stdev   │ Max   │
├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼───────┤
│ Latency │ 1 ms │ 1 ms │ 2 ms  │ 3 ms │ 1.07 ms │ 0.48 ms │ 20 ms │
└─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴───────┘
┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬────────┬─────────┐
│ Stat      │ 1%      │ 2.5%    │ 50%     │ 97.5%   │ Avg     │ Stdev  │ Min     │
├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
│ Req/Sec   │ 2427    │ 2427    │ 3821    │ 3939    │ 3616.8  │ 440.53 │ 2427    │
├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼────────┼─────────┤
│ Bytes/Sec │ 2.14 MB │ 2.14 MB │ 3.36 MB │ 3.47 MB │ 3.18 MB │ 388 kB │ 2.14 MB │
└───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴────────┴─────────┘

Req/Bytes counts sampled once per second.

0 2xx responses, 36164 non 2xx responses
36k requests in 10.01s, 31.8 MB read
Analysing data
Generated HTML file is 

那么為什么我得到?:0 2xx 響應,36164 個非 2xx 響應當我在郵遞員中嘗試使用相同的標題和正文時,它返回 200。

在此先感謝您的幫助

你好

我有同樣的問題。 當您將 autocannon 作為內部命令運行時,標題似乎沒有正確處理。 我嘗試了許多不同的語法。

什么對我autocannon在不同的終端中運行node clinic doctor/flameautocannon

首先在終端 A 中運行:

clinic doctor -- node ./dist/custom/index.js

在第二個終端 B 中運行:

autocannon localhost:<YourPort> --connections 5 -m "POST" -i my-data.json -H "Authorization":"Bearer xxx" 

autocannon 完成后,立即返回終端 A 並使用 CTRL+C 結束診所節點進程。 將分析數據並打印報告。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM