文档章节

Web性能测试工具Siege参数详解 & 示例

强子哥哥
 强子哥哥
发布于 2017/06/04 09:11
字数 5694
阅读 117
收藏 0

在上一篇博文【CentOS上安装Web性能测试工具Siege & 示例】中,给出了CentOS上安装Web性能测试工具Siege的步骤,并给出了一个简单的示例,如

示例 ==> 并发请求指定URL  http://download.joedog.org/

siege -c 5 -r 2 http://download.joedog.org/

参数说明: -c 是并发量并发数为5,  -r 是重复次数 重复2次

某次运行的结果~

Transactions:		          30 hits        ## 完成处理数30
Availability:		      100.00 %           ## 可用,成功率100%
Elapsed time:		        4.67 secs        ## 耗时4.67秒
Data transferred:	        0.07 MB          ## 数据传输0.07MB
Response time:		        0.50 secs        ## 响应时间0.50秒
Transaction rate:	        6.42 trans/sec   ## 每秒完成6.42个处理
Throughput:		        0.01 MB/sec          ## 吞吐量,每秒传输0.01MB
Concurrency:		        3.21             ## 实际最高并发连接数
Successful transactions:          30         ## 成功完成处理30次
Failed transactions:	           0         ## 失败0次
Longest transaction:	        2.25         ## 每次传输所花最长时间
Shortest transaction:	        0.37         ## 每次传输所花最短时间

在本篇博文中,我们将对Siege使用方法和参数,结合示例进行说明~

Siege使用方法

可以先通过siege -h 或者siege --help 命令,查看一下siege的帮助信息,如:

[root@test03 siege-4.0.2]# siege -h
[alert] Zip encoding disabled; siege requires zlib support to enable it
SIEGE 4.0.2
Usage: siege [options]
       siege [options] URL
       siege -g URL
Options:
  -V, --version             VERSION, prints the version number.
  -h, --help                HELP, prints this section.
  -C, --config              CONFIGURATION, show the current config.
  -v, --verbose             VERBOSE, prints notification to screen.
  -q, --quiet               QUIET turns verbose off and suppresses output.
  -g, --get                 GET, pull down HTTP headers and display the
                            transaction. Great for application debugging.
  -c, --concurrent=NUM      CONCURRENT users, default is 10
  -r, --reps=NUM            REPS, number of times to run the test.
  -t, --time=NUMm           TIMED testing where "m" is modifier S, M, or H
                            ex: --time=1H, one hour test.
  -d, --delay=NUM           Time DELAY, random delay before each requst
  -b, --benchmark           BENCHMARK: no delays between requests.
  -i, --internet            INTERNET user simulation, hits URLs randomly.
  -f, --file=FILE           FILE, select a specific URLS FILE.
  -R, --rc=FILE             RC, specify an siegerc file
  -l, --log[=FILE]          LOG to FILE. If FILE is not specified, the
                            default is used: PREFIX/var/siege.log
  -m, --mark="text"         MARK, mark the log file with a string.
                            between .001 and NUM. (NOT COUNTED IN STATS)
  -H, --header="text"       Add a header to request (can be many)
  -A, --user-agent="text"   Sets User-Agent in request
  -T, --content-type="text" Sets Content-Type in request

Copyright (C) 2016 by Jeffrey Fulmer, et al.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.

[root@test03 siege-4.0.2]# 

从上述帮助信息中,可以看出siege的使用方法有如下三种方法

Usage:

  1.        siege [options]
  2.        siege [options] URL
  3.        siege -g URL

其中option的可选项有如下这些:

Options:
  -V, --version             VERSION, prints the version number.
  -h, --help                HELP, prints this section.
  -C, --config              CONFIGURATION, show the current config.
  -v, --verbose             VERBOSE, prints notification to screen.
  -q, --quiet               QUIET turns verbose off and suppresses output.
  -g, --get                 GET, pull down HTTP headers and display the
                            transaction. Great for application debugging.
  -c, --concurrent=NUM      CONCURRENT users, default is 10
  -r, --reps=NUM            REPS, number of times to run the test.
  -t, --time=NUMm           TIMED testing where "m" is modifier S, M, or H
                            ex: --time=1H, one hour test.
  -d, --delay=NUM           Time DELAY, random delay before each requst
  -b, --benchmark           BENCHMARK: no delays between requests.
  -i, --internet            INTERNET user simulation, hits URLs randomly.
  -f, --file=FILE           FILE, select a specific URLS FILE.
  -R, --rc=FILE             RC, specify an siegerc file
  -l, --log[=FILE]          LOG to FILE. If FILE is not specified, the
                            default is used: PREFIX/var/siege.log
  -m, --mark="text"         MARK, mark the log file with a string.
                            between .001 and NUM. (NOT COUNTED IN STATS)
  -H, --header="text"       Add a header to request (can be many)
  -A, --user-agent="text"   Sets User-Agent in request
  -T, --content-type="text" Sets Content-Type in request

siege [options]

该使用方法主要用于:

  • 查看版本信息
  • 查看帮助信息
  • 查看当前配置信息
  • 使用siege -V 或者 siege --version 查看siege版本信息
[root@test03 siege-4.0.2]# siege -V
[alert] Zip encoding disabled; siege requires zlib support to enable it
SIEGE 4.0.2

Copyright (C) 2016 by Jeffrey Fulmer, et al.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.

[root@test03 siege-4.0.2]# 
  • 使用siege -h 或者 siege --help 查看帮助信息
[root@test03 siege-4.0.2]# siege -h
[alert] Zip encoding disabled; siege requires zlib support to enable it
SIEGE 4.0.2
Usage: siege [options]
       siege [options] URL
       siege -g URL
Options:
  -V, --version             VERSION, prints the version number.
  -h, --help                HELP, prints this section.
  -C, --config              CONFIGURATION, show the current config.
  -v, --verbose             VERBOSE, prints notification to screen.
  -q, --quiet               QUIET turns verbose off and suppresses output.
  -g, --get                 GET, pull down HTTP headers and display the
                            transaction. Great for application debugging.
  -c, --concurrent=NUM      CONCURRENT users, default is 10
  -r, --reps=NUM            REPS, number of times to run the test.
  -t, --time=NUMm           TIMED testing where "m" is modifier S, M, or H
                            ex: --time=1H, one hour test.
  -d, --delay=NUM           Time DELAY, random delay before each requst
  -b, --benchmark           BENCHMARK: no delays between requests.
  -i, --internet            INTERNET user simulation, hits URLs randomly.
  -f, --file=FILE           FILE, select a specific URLS FILE.
  -R, --rc=FILE             RC, specify an siegerc file
  -l, --log[=FILE]          LOG to FILE. If FILE is not specified, the
                            default is used: PREFIX/var/siege.log
  -m, --mark="text"         MARK, mark the log file with a string.
                            between .001 and NUM. (NOT COUNTED IN STATS)
  -H, --header="text"       Add a header to request (can be many)
  -A, --user-agent="text"   Sets User-Agent in request
  -T, --content-type="text" Sets Content-Type in request

Copyright (C) 2016 by Jeffrey Fulmer, et al.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.

[root@test03 siege-4.0.2]# 
  • 使用siege -C 或者 siege --config 查看当前Siege的配置信息
[root@test03 siege-4.0.2]# siege -C
[alert] Zip encoding disabled; siege requires zlib support to enable it
CURRENT  SIEGE  CONFIGURATION
Mozilla/5.0 (unknown-x86_64-linux-gnu) Siege/4.0.2
Edit the resource file to change the settings.
----------------------------------------------
version:                        4.0.2
verbose:                        true
color:                          true
quiet:                          false
debug:                          false
protocol:                       HTTP/1.1
HTML parser:                    enabled
get method:                     HEAD
connection:                     close
concurrent users:               25
time to run:                    n/a
repetitions:                    n/a
socket timeout:                 30
accept-encoding:                *
delay:                          0.500 sec
internet simulation:            false
benchmark mode:                 false
failures until abort:           1024
named URL:                      none
URLs file:                      /usr/local/etc/urls.txt
thread limit:                   255
logging:                        false
log file:                       /usr/local/var/log/siege.log
resource file:                  /root/.siege/siege.conf
timestamped output:             false
comma separated output:         false
allow redirects:                true
allow zero byte data:           true
allow chunked encoding:         true
upload unique files:            true
no-follow:
 - ad.doubleclick.net
 - pagead2.googlesyndication.com
 - ads.pubsqrd.com
 - ib.adnxs.com

[root@test03 siege-4.0.2]# 

siege -g URL

获取指定URL的Header信息,并显示HTTP处理信息~

siege -g http://www.baidu.com

[root@test03 siege-4.0.2]# siege -g http://www.baidu.com
[alert] Zip encoding disabled; siege requires zlib support to enable it
HEAD / HTTP/1.0
Host: www.baidu.com
Accept: */*
User-Agent: Mozilla/5.0 (unknown-x86_64-linux-gnu) Siege/4.0.2
Connection: close


HTTP/1.1 200 OK
Server: bfe/1.0.8.18
Date: Sat, 03 Jun 2017 03:02:23 GMT
Content-Type: text/html
Content-Length: 277
Last-Modified: Mon, 13 Jun 2016 02:50:23 GMT
Connection: Close
ETag: "575e1f6f-115"
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Pragma: no-cache
Accept-Ranges: bytes



Transactions:		           1 hits
Availability:		      100.00 %
Elapsed time:		        0.45 secs
Data transferred:	        0.00 MB
Response time:		        0.10 secs
Transaction rate:	        2.22 trans/sec
Throughput:		        0.00 MB/sec
Concurrency:		        0.22
Successful transactions:           1
Failed transactions:	           0
Longest transaction:	        0.10
Shortest transaction:	        0.10
 
[root@test03 siege-4.0.2]# 

 

siege [options] URL

这种使用方法是最主要的,接下来,结合示例对参数的使用进行说明~

Siege参数说明&示例

Siege常用参数

Siege常用的参数有如下几个:

-c 或者 --concurrent=NUM : 用于指定并发人数
-r 或者 --reps=NUM       : 用于指定重复次数
-d 或者 --delay=NUM      : 用于指定延迟时间
-f 或者 --file=FILE      : 用于指定URL列表的文件,可以一次对多个路径进行测试
-t 或者 --time=NUMm      : 用于指定测试持续时间。例如: -t10S (10秒)  -t5M(5分钟)  -t1H(1小时)
-l 或者 --log[=FILE]     : 用于记录结果日志

一般测试基本上多个参数组合在一起来完成的,下面,我们就一起来玩几个测试示例~

并发请求URL

siege -c5 -r2 http://www.bing.com

[root@test03 siege-4.0.2]# siege -c5 -r2 http://www.bing.com
[alert] Zip encoding disabled; siege requires zlib support to enable it
** SIEGE 4.0.2
** Preparing 5 concurrent users for battle.
The server is now under siege...
HTTP/1.1 301     0.13 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.14 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.14 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.14 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.14 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.27 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.32 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.37 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.43 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.50 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.22 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.17 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.12 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.05 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.24 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.28 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.30 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.34 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.22 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.16 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.11 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.34 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png

Transactions:		          30 hits
Availability:		      100.00 %
Elapsed time:		        1.73 secs
Data transferred:	        1.27 MB
Response time:		        0.19 secs
Transaction rate:	       17.34 trans/sec
Throughput:		        0.73 MB/sec
Concurrency:		        3.27
Successful transactions:          30
Failed transactions:	           0
Longest transaction:	        0.50
Shortest transaction:	        0.05
 
[root@test03 siege-4.0.2]# 

在此基础上增加持续时间,设置为5秒

siege -c5 -r2 -t5S http://www.bing.com

[root@test03 siege-4.0.2]# siege -c5 -r2 -t5S http://www.bing.com
[alert] Zip encoding disabled; siege requires zlib support to enable it
[error] CONFIG conflict: selected time and repetition based testing
defaulting to time-based testing: 5 seconds
** SIEGE 4.0.2
** Preparing 5 concurrent users for battle.
The server is now under siege...
HTTP/1.1 301     0.13 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.14 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.14 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.14 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.14 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.19 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.25 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.32 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.36 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.42 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.23 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.17 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.11 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.22 secs:  126124 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.05 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.05 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.28 secs:  126124 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.45 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.49 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.35 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.52 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.15 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.10 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.28 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.25 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.25 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.08 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.23 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.25 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.18 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.13 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.29 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.05 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.05 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.28 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.31 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.31 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.34 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.38 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.24 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.18 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.13 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.05 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.24 secs:  126124 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.05 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.25 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.24 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.29 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.30 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.22 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.11 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.18 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.35 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.05 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.05 secs:       0 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.27 secs:  126124 bytes ==> GET  /
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.25 secs:  126124 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.07 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.23 secs:  126124 bytes ==> GET  /
HTTP/1.1 301     0.06 secs:       0 bytes ==> GET  /
HTTP/1.1 200     0.24 secs:  126124 bytes ==> GET  /

Lifting the server siege...
Transactions:		          91 hits
Availability:		      100.00 %
Elapsed time:		        4.51 secs
Data transferred:	        3.92 MB
Response time:		        0.17 secs
Transaction rate:	       20.18 trans/sec
Throughput:		        0.87 MB/sec
Concurrency:		        3.36
Successful transactions:          93
Failed transactions:	           0
Longest transaction:	        0.52
Shortest transaction:	        0.05
 
[root@test03 siege-4.0.2]# 

多个URL场景测试

问题: 如果想测试多个URL怎么办呢?

我们只要将多个URL存放到一个文件中即可~

通过siege -C我们可以看到如下信息,

[root@test03 siege-4.0.2]# siege -C
[alert] Zip encoding disabled; siege requires zlib support to enable it
CURRENT  SIEGE  CONFIGURATION
Mozilla/5.0 (unknown-x86_64-linux-gnu) Siege/4.0.2
Edit the resource file to change the settings.
----------------------------------------------
version:                        4.0.2
verbose:                        true
color:                          true
quiet:                          false
debug:                          false
protocol:                       HTTP/1.1
HTML parser:                    enabled
get method:                     HEAD
connection:                     close
concurrent users:               25
time to run:                    n/a
repetitions:                    n/a
socket timeout:                 30
accept-encoding:                *
delay:                          0.500 sec
internet simulation:            false
benchmark mode:                 false
failures until abort:           1024
named URL:                      none
URLs file:                      /usr/local/etc/urls.txt
thread limit:                   255
logging:                        false
log file:                       /usr/local/var/log/siege.log
resource file:                  /root/.siege/siege.conf
timestamped output:             false
comma separated output:         false
allow redirects:                true
allow zero byte data:           true
allow chunked encoding:         true
upload unique files:            true
no-follow:
 - ad.doubleclick.net
 - pagead2.googlesyndication.com
 - ads.pubsqrd.com
 - ib.adnxs.com

[root@test03 siege-4.0.2]# 

从上述信息中可以看出,Siege默认情况下URLS FILE的路径为/usr/local/etc/urls.txt

urls.txt的内容如下:


# URLS file for siege
# --
# Format the url entries in any of the following formats:
# http://www.whoohoo.com/index.html
# http://www/index.html
# www/index.html
# http://www.whoohoo.com/cgi-bin/howto/display.cgi?1013
# Use the POST directive for pages that require it:
# http://www.whoohoo.com/cgi-bin/haha.cgi POST ha=1&ho=2
#      or POST content from a file:
# http://www.whoohoo.com/melvin.jsp POST </home/jeff/haha
# http://www.whoohoo.com/melvin.jsp POST <./haha
# You may also set and reference variables inside this file,
# for more information, man urls_txt
# -------------------------------------------------------

我们可以通过 -f参数来指定一个文件,如/srv/myurls.txt, 里面存放指定网址

http://www.baidu.com
http://cn.bing.com/

注,上述URL很简单,并不在Header或者其他地方设置参数~

使用如下命令即可~

siege -c5 -r2 -f /srv/myurls.txt 

[root@test03 siege-4.0.2]# siege -c5 -r2 -f /srv/myurls.txt 
[alert] Zip encoding disabled; siege requires zlib support to enable it
** SIEGE 4.0.2
** Preparing 5 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200     0.14 secs:  102074 bytes ==> GET  /
HTTP/1.1 200     0.16 secs:  102202 bytes ==> GET  /
HTTP/1.1 200     0.19 secs:  102123 bytes ==> GET  /
HTTP/1.1 200     0.25 secs:  102238 bytes ==> GET  /
HTTP/1.1 200     0.14 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.12 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.09 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.28 secs:  102168 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.06 secs:      91 bytes ==> GET  /img/gs.gif
HTTP/1.1 200     0.06 secs:      91 bytes ==> GET  /img/gs.gif
HTTP/1.1 200     0.06 secs:      91 bytes ==> GET  /img/gs.gif
HTTP/1.1 200     0.06 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.06 secs:      91 bytes ==> GET  /img/gs.gif
HTTP/1.1 200     0.05 secs:      91 bytes ==> GET  /img/gs.gif
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
HTTP/1.1 200     0.05 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.05 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.05 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.06 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.07 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.06 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.06 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.06 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.07 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.06 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.28 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.28 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.30 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.17 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.10 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.32 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.23 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.07 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png

Transactions:		          40 hits
Availability:		       88.89 %
Elapsed time:		        1.62 secs
Data transferred:	        1.62 MB
Response time:		        0.11 secs
Transaction rate:	       24.69 trans/sec
Throughput:		        1.00 MB/sec
Concurrency:		        2.81
Successful transactions:          40
Failed transactions:	           5
Longest transaction:	        0.32
Shortest transaction:	        0.05
 
[root@test03 siege-4.0.2]# 

 

记录结果到日志

如果想把测试结果存放到日志文件中去,可以使用--log参数,如:

 siege -c5 -r2 --log=/srv/siege_result.log  -f /srv/myurls.txt

[root@test03 srv]# siege -c5 -r2 --log=/srv/siege_result.log  -f /srv/myurls.txt
[alert] Zip encoding disabled; siege requires zlib support to enable it
** SIEGE 4.0.2
** Preparing 5 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200     0.15 secs:  102110 bytes ==> GET  /
HTTP/1.1 200     0.20 secs:  102087 bytes ==> GET  /
HTTP/1.1 200     0.24 secs:  101920 bytes ==> GET  /
HTTP/1.1 200     0.27 secs:  102186 bytes ==> GET  /
HTTP/1.1 200     0.15 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.09 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.30 secs:  101935 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.06 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.06 secs:      91 bytes ==> GET  /img/gs.gif
HTTP/1.1 200     0.06 secs:      91 bytes ==> GET  /img/gs.gif
HTTP/1.1 200     0.06 secs:    2947 bytes ==> GET  /baidu.html?from=noscript
HTTP/1.1 200     0.06 secs:      91 bytes ==> GET  /img/gs.gif
HTTP/1.1 200     0.07 secs:      91 bytes ==> GET  /img/gs.gif
HTTP/1.1 200     0.06 secs:      91 bytes ==> GET  /img/gs.gif
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
[error] HTTPS requires libssl: Unable to reach ss1.bdstatic.com with this protocol: Transport endpoint is already connected
HTTP/1.1 200     0.05 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.06 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.06 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.06 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.07 secs:   93750 bytes ==> GET  /r/www/cache/static/jquery/jquery-1.10.2.min_65682a2.js
HTTP/1.1 200     0.06 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.06 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.06 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.07 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.06 secs:     705 bytes ==> GET  /img/baidu_jgylogo3.gif
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.07 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.06 secs:    7877 bytes ==> GET  /img/bd_logo1.png
HTTP/1.1 200     0.26 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.29 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.12 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.30 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.25 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.25 secs:  126193 bytes ==> GET  /
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png
HTTP/1.1 200     0.06 secs:    6752 bytes ==> GET  /rms/rms%20answers%20Homepage%20ZhCn$BingAppQR/ic/0d08e928/0f482622.png

Transactions:		          40 hits
Availability:		       88.89 %
Elapsed time:		        1.70 secs
Data transferred:	        1.62 MB
Response time:		        0.11 secs
Transaction rate:	       23.53 trans/sec
Throughput:		        0.95 MB/sec
Concurrency:		        2.66
Successful transactions:          40
Failed transactions:	           5
Longest transaction:	        0.30
Shortest transaction:	        0.05
 
LOG FILE: /srv/siege_result.log
You can disable this log file notification by editing
/root/.siege/siege.conf and changing 'show-logfile' to false.
[root@test03 srv]# 

其中,

Transactions:		          40 hits
Availability:		       88.89 %
Elapsed time:		        1.70 secs
Data transferred:	        1.62 MB
Response time:		        0.11 secs
Transaction rate:	       23.53 trans/sec
Throughput:		        0.95 MB/sec
Concurrency:		        2.66
Successful transactions:          40
Failed transactions:	           5
Longest transaction:	        0.30
Shortest transaction:	        0.05

这些结果信息会记录到指定的siege_result.log文件中,

  Date & Time,  Trans,  Elap Time,  Data Trans,  Resp Time,  Trans Rate,  Throughput,  Concurrent,    OKAY,   Failed
2017-06-03 14:37:03,     40,       1.70,           1,       0.11,       23.53,        0.59,        2.66,      40,       5

Header参数传值

在平时写接口的时候,可能需要先通过一个key获得相应的token,在这种时候,获取token的接口,需要在Header中设置key的参数和值。

在这种情况下,可以通过--header "key:abcdefg123456789" 这样的方法来进行测试~

如:

 siege -c5 -r2 --header "key:WJPRVEZEPMGX4RYESQ4ZPYPQLP2G0HCA" http://127.0.0.1:8080/accessToken

测试示例:

[root@test03 srv]#  siege -c5 -r2 --header "key:WJPRVEZEPMGX4RYESQ4ZPYPQLP2G0HCA" http://127.0.0.1:8080/accessToken
[alert] Zip encoding disabled; siege requires zlib support to enable it
** SIEGE 4.0.2
** Preparing 5 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200     0.06 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.06 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.08 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.09 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.09 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.02 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.02 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.02 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.02 secs:      99 bytes ==> GET  /accessToken
HTTP/1.1 200     0.02 secs:      99 bytes ==> GET  /accessToken

Transactions:		          10 hits
Availability:		      100.00 %
Elapsed time:		        0.77 secs
Data transferred:	        0.00 MB
Response time:		        0.05 secs
Transaction rate:	       12.99 trans/sec
Throughput:		        0.00 MB/sec
Concurrency:		        0.62
Successful transactions:          10
Failed transactions:	           0
Longest transaction:	        0.09
Shortest transaction:	        0.02
 
[root@test03 srv]# 

POST + JSON测试

 

假设我们需要测试一个接口方法,POST请求,请求内容为JSON, 并且需要在Header中使用AccessToken。

问题:

这样的情况,我们如何进行传值和测试呢?

Header中的传值可以使用--header "accessToken:c6fe5634d629497ba1bb9e89c2e2fb59"来完成。

至于提交的JSON内容,可以将其放到一个文件中( 如myjson.txt ), 本示例文件中的内容如下:

{
        "actions":[{
                "actionId":"set_room_temp",
                "value":28
        }]
}

然后指定URL路径 和 json体的文件路径

'http://127.0.0.1/v1/control/3WIMLT4P3FZvirtualsn0000000 POST < /srv/myjson.txt'

注意:

上述内容需要用单引号括起来,否则会产生错误~

本文使用的示例如下:

siege -c5 -r1 --header "accessToken:c6fe5634d629497ba1bb9e89c2e2fb59" 'http://127.0.0.1/v1/control/3WIMLT4P3FZvirtualsn0000000 POST < /srv/myjson.txt'

[root@test03 srv]# siege -c5 -r1 --header "accessToken:c6fe5634d629497ba1bb9e89c2e2fb59" 'http://127.0.0.1/v1/control/3WIMLT4P3FZvirtualsn0000000 POST < /srv/myjson.txt'
[alert] Zip encoding disabled; siege requires zlib support to enable it
** SIEGE 4.0.2
** Preparing 5 concurrent users for battle.
The server is now under siege...
HTTP/1.1 200     0.13 secs:      57 bytes ==> POST http://127.0.0.1/v1/control/3WIMLT4P3FZvirtualsn0000000
HTTP/1.1 200     0.13 secs:      57 bytes ==> POST http://127.0.0.1/v1/control/3WIMLT4P3FZvirtualsn0000000
HTTP/1.1 200     0.14 secs:      57 bytes ==> POST http://127.0.0.1/v1/control/3WIMLT4P3FZvirtualsn0000000
HTTP/1.1 200     0.15 secs:      57 bytes ==> POST http://127.0.0.1/v1/control/3WIMLT4P3FZvirtualsn0000000
HTTP/1.1 200     0.16 secs:      57 bytes ==> POST http://127.0.0.1/v1/control/3WIMLT4P3FZvirtualsn0000000

Transactions:		           5 hits
Availability:		      100.00 %
Elapsed time:		        0.54 secs
Data transferred:	        0.00 MB
Response time:		        0.14 secs
Transaction rate:	        9.26 trans/sec
Throughput:		        0.00 MB/sec
Concurrency:		        1.31
Successful transactions:           5
Failed transactions:	           0
Longest transaction:	        0.16
Shortest transaction:	        0.13
 
[root@test03 srv]#

小结

通过上述的介绍,Siege常用的参数和使用示例基本上写完了。

有兴趣的读者,可以到Siege官网【https://www.joedog.org/siege-manual/】上去查看更多的资料~ 

本文转载自:https://my.oschina.net/wangmengjun/blog/913745

共有 人打赏支持
强子哥哥

强子哥哥

粉丝 859
博文 899
码字总数 614462
作品 8
南京
架构师
服务器压力测试工具

目录 ab http_load webbench Siege ab 安装 是 自带的一款功能强大的测试工具,安装了 一般就自带了 测试 缺陷 程序中有各种静态声明的固定长度的缓冲区。 另外,对命令行参数、服务器的响应...

好铁
2016/08/28
36
0
VPS服务器性能压力测试工具(转载)

VPS服务器性能 压力测试工具 http_load、webbench、ab、Siege使用教程 一、http_load 程序非常小,解压后也不到100K http_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载。但是...

Qadir.luo
2010/11/29
0
0
压力测试工具Siege安装与使用

Siege 是Linux/Unix下的一个WEB系统的压力测试工具。 下载与安装: 下载地址: http://download.joedog.org/siege/目前最新版本是 2016-05-20 发布的 siege-4.0.2.tar.gz 查看是否安装成功: 参...

王永濤
2016/09/08
1K
1
Web 服务器基准测试,nginx+php vs Apache+php

本次测试nginx+php与apache+php哪种组合的计算性能及稳定性更佳 操作系统:Centos6.4 x64 硬件环境: 实验思路:在本次测试中打算采用,同版本组合测试,如(nginx1.4.4+php5.5.7)vs (httpd...

qw87112
2016/03/01
0
0
学习PHP精粹,编写高效PHP代码之自动测试

如果要制造出完美的产品,必须对它进行全方面检验测试。这里有几种类型的测试,每一种测试都针对应用程序的某个具体方面。 本文将对单元测试、数据库测试、系统测试、负载测试进行介绍。 一、...

风格时光
2014/06/08
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

OSChina 周三乱弹 —— 我居然在 osc 里追剧

Osc乱弹歌单(2018)请戳(这里) 【今日歌曲】 @舆情风控小组 :分享王菲的单曲《笑忘书》 《笑忘书》- 王菲 手机党少年们想听歌,请使劲儿戳(这里) @艾尔库鲁斯:如果给大家一个选择的机...

小小编辑
38分钟前
45
4
rabbitMq的客户端使用笔记

1、channel声明队列的queueDeclare方法的参数解析 durable: 是否持久化, 队列的声明默认是存放到内存中的,如果rabbitmq重启会丢失,如果想重启之后还存在就要使队列持久化,保存到Erlang自...

DemonsI
46分钟前
0
0
“全新” 编程语言 Julia开箱体验

本文共 851字,阅读大约需要 3分钟 ! 概 述 Julia 是一个 “全新”的高性能动态编程语言,前两天迎来了其 1.0 正式版的重大更新。Julia集 Python、C、R、Ruby 之所长,感觉就像一种脚本语言...

CodeSheep
今天
11
0
软件自动化测试初学者忠告

题外话 测试入门 很多受过高等教育的大学生经常问要不要去报测试培训班来入门测试。 答案是否。 高等教育的合格毕业生要具备自学能力,如果你不具备自学能力,要好好地反省一下,为什么自己受...

python测试开发人工智能安全
今天
5
0
java并发备忘

不安全的“先检查后执行”,代码形式如下: if(条件满足){ //这里容易出现线程安全问题//doSomething}else{//doOther} 读取-修改-写入 原子操作:使用CAS技术,即首先从V中读取...

Funcy1122
今天
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部