siege实战步骤:
- 安装rz、sz,下载SecureCRT工具进行阿里云服务器的ssh连接
- 完成siege实战
需求1: 使用siege对多个页面进行加压
(并发数5,持续运行1分钟)
Transactions: 1048 hitsAvailability: 95.45 %Elapsed time: 59.51 secsData transferred: 154.33 MBResponse time: 0.22 secsTransaction rate: 17.61 trans/secThroughput: 2.59 MB/secConcurrency: 3.93Successful transactions: 896Failed transactions: 50Longest transaction: 2.39Shortest transaction: 0.07
需求2: 保存siege日志
Transactions: 1113 hitsAvailability: 95.05 %Elapsed time: 59.87 secsData transferred: 167.95 MBResponse time: 0.21 secsTransaction rate: 18.59 trans/secThroughput: 2.81 MB/secConcurrency: 3.96Successful transactions: 950Failed transactions: 58Longest transaction: 0.60Shortest transaction: 0.07LOG FILE: result.csvYou can disable this log file notification by editing/root/.siege/siege.conf and changing 'show-logfile' to false.root@iZ2ze0ht45qn4m8m1wjfdrZ:~# sz result.csvrzStarting zmodem transfer. Press Ctrl+C to cancel.Transferring result.csv... 100% 365 bytes 365 bytes/sec 00:00:01 0 Errors
result.csv日志内容:
需求3: 压测时启用gzip压缩
Transactions: 820 hitsAvailability: 100.00 %Elapsed time: 59.57 secsData transferred: 4.56 MBResponse time: 0.36 secsTransaction rate: 13.77 trans/secThroughput: 0.08 MB/secConcurrency: 4.98Successful transactions: 820Failed transactions: 0Longest transaction: 0.54Shortest transaction: 0.33 LOG FILE: result_gip.csv
result_gip.csv日志内容:
需求4: 对移动站点进行压测
- 1.桌面版本百度首页请求
Transactions: 6 hitsAvailability: 85.71 %Elapsed time: 0.73 secsData transferred: 0.21 MBResponse time: 0.11 secsTransaction rate: 8.22 trans/secThroughput: 0.28 MB/secConcurrency: 0.93Successful transactions: 6Failed transactions: 1Longest transaction: 0.19Shortest 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 hitsAvailability: 100.00 %Elapsed time: 0.17 secsData transferred: 0.01 MBResponse time: 0.09 secsTransaction rate: 11.76 trans/secThroughput: 0.03 MB/secConcurrency: 1.00Successful transactions: 2Failed transactions: 0Longest transaction: 0.09Shortest transaction: 0.08