使用 siege 负载测试工具,它将许多事务发送到服务器。
输出通常类似于:
** SIEGE 4.0.4
** Preparing 1 concurrent users for battle.
The server is now under siege...
Transactions: 10 hits
Availability: 100.00 %
Elapsed time: 14.31 secs
Data transferred: 0.09 MB
Response time: 1.43 secs
Transaction rate: 0.70 trans/sec
Throughput: 0.01 MB/sec
Concurrency: 1.00
Successful transactions: 10
Failed transactions: 0
Longest transaction: 4.54
Shortest transaction: 0.00
有时在测试中我看到成功的事务数加上失败的事务数不等于事务的总数(例如 1000 个事务,992 个成功,4 个失败)。有时总数较低,有时总数较高(例如 1000 次交易,998 次成功,4 次失败)。这是什么意思?这些不成功和不失败的交易发生了什么?