学习siege实战

siege实战步骤:

  1. 安装rz、sz,下载SecureCRT工具进行阿里云服务器的ssh连接
  2. 完成siege实战

需求1: 使用siege对多个页面进行加压

(并发数5,持续运行1分钟)

Transactions:                   1048 hits
Availability:                  95.45 %
Elapsed time:                  59.51 secs
Data transferred:             154.33 MB
Response time:                  0.22 secs
Transaction rate:              17.61 trans/sec
Throughput:                     2.59 MB/sec
Concurrency:                    3.93
Successful transactions:         896
Failed transactions:              50
Longest transaction:            2.39
Shortest transaction:           0.07

需求2: 保存siege日志

Transactions:                   1113 hits
Availability:                  95.05 %
Elapsed time:                  59.87 secs
Data transferred:             167.95 MB
Response time:                  0.21 secs
Transaction rate:              18.59 trans/sec
Throughput:                     2.81 MB/sec
Concurrency:                    3.96
Successful transactions:         950
Failed transactions:              58
Longest transaction:            0.60
Shortest transaction:           0.07
LOG FILE: result.csv
You can disable this log file notification by editing
/root/.siege/siege.conf and changing 'show-logfile' to false.
root@iZ2ze0ht45qn4m8m1wjfdrZ:~# sz result.csv
rz
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring result.csv...
  100%     365 bytes  365 bytes/sec 00:00:01       0 Errors  

result.csv日志内容:

K2awn.md.png

需求3: 压测时启用gzip压缩

Transactions:                    820 hits
Availability:                 100.00 %
Elapsed time:                  59.57 secs
Data transferred:               4.56 MB
Response time:                  0.36 secs
Transaction rate:              13.77 trans/sec
Throughput:                     0.08 MB/sec
Concurrency:                    4.98
Successful transactions:         820
Failed transactions:               0
Longest transaction:            0.54
Shortest transaction:           0.33
 
LOG FILE: result_gip.csv

result_gip.csv日志内容:

K2kM9.md.png

需求4: 对移动站点进行压测

  • 1.桌面版本百度首页请求
Transactions:                      6 hits
Availability:                  85.71 %
Elapsed time:                   0.73 secs
Data transferred:               0.21 MB
Response time:                  0.11 secs
Transaction rate:               8.22 trans/sec
Throughput:                     0.28 MB/sec
Concurrency:                    0.93
Successful transactions:           6
Failed transactions:               1
Longest transaction:            0.19
Shortest transaction:           0.08
  • 2.移动版百度首页请求(模拟iphone6试一下,user-agent:Apple-iPhone7C2/1202.466)
    siege -c1 -r1 -A"Apple-iPhone7C2/1202.466" http://www.baidu.com
Transactions:                      2 hits
Availability:                 100.00 %
Elapsed time:                   0.17 secs
Data transferred:               0.01 MB
Response time:                  0.09 secs
Transaction rate:              11.76 trans/sec
Throughput:                     0.03 MB/sec
Concurrency:                    1.00
Successful transactions:           2
Failed transactions:               0
Longest transaction:            0.09
Shortest transaction:           0.08
原文地址:https://www.cnblogs.com/sandysun/p/8759483.html