PoW Shield Go
在Go中实现PoW Shield,用于压力测试。
使用方法
安装该软件包
go mod tidy
运行
go run main.go
压力测试
注意:这只适用于非容器化版本的PoW Shield,在运行测试时你的系统可能会出现不稳定的情况:
# Start the stress test
npm run stress
# If you changed the PORT variable in .env, you should also change the target variable in the stress test script
nano scripts/stress.sh
以下测试是在i7-12700H CPU上进行的,每个并发的参数有1个100%利用率的核心和60秒的时间。
大量GET
| 并发连接 | 平均延时 | 错误率 | 请求/秒 |
|---|---|---|---|
| 64 | 毫秒 | 0 | |
| 128 | 0 | 0 | |
| 256 | 毫秒 | 0 | |
| 512 | 毫秒 | 0 | |
| 1024 | 毫秒 | 0 | |
| 2048 | 毫秒 | 0 | |
| 4096 | ms | 0 |
Nonce Flood
| 并发连接 | 平均延时 | 错误率 | 请求/秒 |
|---|---|---|---|
| 64 | 毫秒 | 不适用 | |
| 128 | 毫秒 | 不适用 | |
| 256 | 毫秒 | 不适用 | |
| 512 | 毫秒 | 不适用 | |
| 1024 | 毫秒 | 不适用 | |
| 2048 | 毫秒 | 不适用 | |
| 4096 | 微秒 | 不适用 |