Siege是什么?
Siege是一个压力测试和评测工具,设计用于WEB开发这评估应用在压力下的承受能力:可以根据配置对一个WEB站点进行多用户的并发访问,记录每个用户所有请求过程的相应时间,并在一定数量的并发访问下重复进行。
安装Siege
下载Siege安装包
可以访问【http://download.joedog.org/siege/】下载Siege安装包,本文下载的是siege-4.0.2.tar.gz
使用wget下载安装包~
wget http://download.joedog.org/siege/siege-4.0.2.tar.gz
如:
[root@test03 srv]# wget http://download.joedog.org/siege/siege-4.0.2.tar.gz --2017-06-02 17:30:09-- http://download.joedog.org/siege/siege-4.0.2.tar.gz Resolving download.joedog.org... 52.24.24.107 Connecting to download.joedog.org|52.24.24.107|:80... connected. HTTP request sent,awaiting response... 200 OK Length: 521228 (509K) [application/x-gzip] Saving to: “siege-4.0.2.tar.gz” 100%[====================================================================================================================================================================================================================================>] 521,228 387K/s in 1.3s 2017-06-02 17:30:12 (387 KB/s) - “siege-4.0.2.tar.gz” saved [521228/521228] [root@test03 srv]#
解压
将下载好的siege安装包解开~
tar -zvxf siege-4.0.2.tar.gz
如,
[root@test03 srv]# tar -zvxf siege-4.0.2.tar.gz siege-4.0.2/ siege-4.0.2/src/ siege-4.0.2/src/timer.h siege-4.0.2/src/handler.c siege-4.0.2/src/browser.c siege-4.0.2/src/handler.h siege-4.0.2/src/base64.h siege-4.0.2/src/cookie.h siege-4.0.2/src/timer.c siege-4.0.2/src/main.c siege-4.0.2/src/init.c siege-4.0.2/src/util.c siege-4.0.2/src/auth.h siege-4.0.2/src/cookies.h siege-4.0.2/src/data.h siege-4.0.2/src/stralloc.c siege-4.0.2/src/creds.c siege-4.0.2/src/page.c siege-4.0.2/src/cache.c siege-4.0.2/src/data.c siege-4.0.2/src/perl.h siege-4.0.2/src/cookies.c siege-4.0.2/src/http.c siege-4.0.2/src/hash.c siege-4.0.2/src/util.h siege-4.0.2/src/response.h siege-4.0.2/src/response.c siege-4.0.2/src/stralloc.h siege-4.0.2/src/ssl.c siege-4.0.2/src/ftp.c siege-4.0.2/src/date.h siege-4.0.2/src/hash.h siege-4.0.2/src/init.h siege-4.0.2/src/page.h siege-4.0.2/src/url.h siege-4.0.2/src/date.c siege-4.0.2/src/notify.h siege-4.0.2/src/parser.c siege-4.0.2/src/load.h siege-4.0.2/src/load.c siege-4.0.2/src/http.h siege-4.0.2/src/ansidecl.h siege-4.0.2/src/md5.c siege-4.0.2/src/ssl.h siege-4.0.2/src/memory.h siege-4.0.2/src/array.c siege-4.0.2/src/browser.h siege-4.0.2/src/getopt.c siege-4.0.2/src/version.c siege-4.0.2/src/array.h siege-4.0.2/src/Makefile.in siege-4.0.2/src/eval.c siege-4.0.2/src/parser.h siege-4.0.2/src/setup.h siege-4.0.2/src/log.h siege-4.0.2/src/cache.h siege-4.0.2/src/crew.c siege-4.0.2/src/creds.h siege-4.0.2/src/log.c siege-4.0.2/src/sock.c siege-4.0.2/src/memory.c siege-4.0.2/src/crew.h siege-4.0.2/src/version.h siege-4.0.2/src/ftp.h siege-4.0.2/src/cfg.c siege-4.0.2/src/url.c siege-4.0.2/src/eval.h siege-4.0.2/src/md5.h siege-4.0.2/src/perl.c siege-4.0.2/src/Makefile.am siege-4.0.2/src/sock.h siege-4.0.2/src/cfg.h siege-4.0.2/src/getopt1.c siege-4.0.2/src/auth.c siege-4.0.2/src/notify.c siege-4.0.2/src/base64.c siege-4.0.2/src/cookie.c siege-4.0.2/COPYING siege-4.0.2/utils/ siege-4.0.2/utils/compile siege-4.0.2/utils/config.guess siege-4.0.2/utils/install-sh siege-4.0.2/utils/config.sub siege-4.0.2/utils/bombardment.in siege-4.0.2/utils/ltmain.sh siege-4.0.2/utils/siege2csv.in siege-4.0.2/utils/bootstrap siege-4.0.2/utils/missing siege-4.0.2/utils/mkstamp siege-4.0.2/utils/Makefile.in siege-4.0.2/utils/siege.config.in siege-4.0.2/utils/Makefile.am siege-4.0.2/utils/mkinstalldirs siege-4.0.2/utils/mdate-sh siege-4.0.2/doc/ siege-4.0.2/doc/siege2csv.1.in siege-4.0.2/doc/urls.txt siege-4.0.2/doc/Makefile.in siege-4.0.2/doc/siege.config.1.in siege-4.0.2/doc/siege2csv.pod siege-4.0.2/doc/bombardment.pod siege-4.0.2/doc/siege.pod siege-4.0.2/doc/bombardment.1.in siege-4.0.2/doc/siege.config.pod siege-4.0.2/doc/siege.1.in siege-4.0.2/doc/Makefile.am siege-4.0.2/doc/siegerc.in siege-4.0.2/INSTALL siege-4.0.2/include/ siege-4.0.2/include/joedog/ siege-4.0.2/include/joedog/path.h siege-4.0.2/include/joedog/getopt.h siege-4.0.2/include/joedog/Makefile.in siege-4.0.2/include/joedog/defs.h siege-4.0.2/include/joedog/boolean.h siege-4.0.2/include/joedog/Makefile.am siege-4.0.2/include/config.h.in siege-4.0.2/include/Makefile.in siege-4.0.2/include/Makefile.am siege-4.0.2/README.md siege-4.0.2/install-sh siege-4.0.2/configure.ac siege-4.0.2/aclocal.m4 siege-4.0.2/acinclude.m4 siege-4.0.2/ChangeLog siege-4.0.2/Makefile.in siege-4.0.2/html/ siege-4.0.2/html/basic.PHP siege-4.0.2/html/README siege-4.0.2/html/etag.PHP siege-4.0.2/html/cookie-expire.PHP siege-4.0.2/html/cache-control.PHP siege-4.0.2/html/Makefile.in siege-4.0.2/html/login.PHP siege-4.0.2/html/Makefile.am siege-4.0.2/configure siege-4.0.2/Makefile.am siege-4.0.2/acspecific.m4 siege-4.0.2/AUTHORS [root@test03 srv]#
configure
进入解压缩后siege目录,执行./configure
[root@test03 srv]# cd siege-4.0.2 [root@test03 siege-4.0.2]# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for style of include used by make... GNU checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/srv/siege-4.0.2': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details [root@test03 siege-4.0.2]#
报错了~
configure: error: no acceptable C compiler found in $PATH
安装gcc即可~
安装gcc
yum install gcc
[root@test03 siege-4.0.2]# yum install gcc Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile ISO | 3.7 kB 00:00 Resolving Dependencies --> Running transaction check ---> Package gcc.x86_64 0:4.4.7-18.el6 will be installed --> Processing Dependency: libgomp = 4.4.7-18.el6 for package: gcc-4.4.7-18.el6.x86_64 --> Processing Dependency: cpp = 4.4.7-18.el6 for package: gcc-4.4.7-18.el6.x86_64 --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-18.el6.x86_64 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-18.el6.x86_64 --> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.4.7-18.el6.x86_64 --> Running transaction check ---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed --> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 --> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64 ---> Package cpp.x86_64 0:4.4.7-18.el6 will be installed --> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-18.el6.x86_64 ---> Package glibc-devel.x86_64 0:2.12-1.209.el6 will be installed --> Processing Dependency: glibc-headers = 2.12-1.209.el6 for package: glibc-devel-2.12-1.209.el6.x86_64 --> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.209.el6.x86_64 ---> Package libgomp.x86_64 0:4.4.7-18.el6 will be installed --> Running transaction check ---> Package glibc-headers.x86_64 0:2.12-1.209.el6 will be installed --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.209.el6.x86_64 --> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.209.el6.x86_64 ---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed ---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed --> Running transaction check ---> Package kernel-headers.x86_64 0:2.6.32-696.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================================================================================================================== Package Arch Version Repository Size ============================================================================================================================================================================================================================================================================== Installing: gcc x86_64 4.4.7-18.el6 ISO 10 M Installing for dependencies: cloog-ppl x86_64 0.15.7-1.2.el6 ISO 93 k cpp x86_64 4.4.7-18.el6 ISO 3.7 M glibc-devel x86_64 2.12-1.209.el6 ISO 990 k glibc-headers x86_64 2.12-1.209.el6 ISO 619 k kernel-headers x86_64 2.6.32-696.el6 ISO 4.5 M libgomp x86_64 4.4.7-18.el6 ISO 134 k mpfr x86_64 2.4.1-6.el6 ISO 157 k ppl x86_64 0.10.2-11.el6 ISO 1.3 M Transaction Summary ============================================================================================================================================================================================================================================================================== Install 9 Package(s) Total download size: 22 M Installed size: 39 M Is this ok [y/N]:
选择y
Is this ok [y/N]: y Downloading Packages: (1/9): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm | 93 kB 00:00 (2/9): cpp-4.4.7-18.el6.x86_64.rpm | 3.7 MB 00:00 (3/9): gcc-4.4.7-18.el6.x86_64.rpm | 10 MB 00:00 (4/9): glibc-devel-2.12-1.209.el6.x86_64.rpm | 990 kB 00:00 (5/9): glibc-headers-2.12-1.209.el6.x86_64.rpm | 619 kB 00:00 (6/9): kernel-headers-2.6.32-696.el6.x86_64.rpm | 4.5 MB 00:00 (7/9): libgomp-4.4.7-18.el6.x86_64.rpm | 134 kB 00:00 (8/9): mpfr-2.4.1-6.el6.x86_64.rpm | 157 kB 00:00 (9/9): ppl-0.10.2-11.el6.x86_64.rpm | 1.3 MB 00:00 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Total 24 MB/s | 22 MB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : ppl-0.10.2-11.el6.x86_64 1/9 Installing : cloog-ppl-0.15.7-1.2.el6.x86_64 2/9 Installing : mpfr-2.4.1-6.el6.x86_64 3/9 Installing : cpp-4.4.7-18.el6.x86_64 4/9 Installing : libgomp-4.4.7-18.el6.x86_64 5/9 Installing : kernel-headers-2.6.32-696.el6.x86_64 6/9 Installing : glibc-headers-2.12-1.209.el6.x86_64 7/9 Installing : glibc-devel-2.12-1.209.el6.x86_64 8/9 Installing : gcc-4.4.7-18.el6.x86_64 9/9 Verifying : kernel-headers-2.6.32-696.el6.x86_64 1/9 Verifying : cpp-4.4.7-18.el6.x86_64 2/9 Verifying : glibc-headers-2.12-1.209.el6.x86_64 3/9 Verifying : libgomp-4.4.7-18.el6.x86_64 4/9 Verifying : mpfr-2.4.1-6.el6.x86_64 5/9 Verifying : glibc-devel-2.12-1.209.el6.x86_64 6/9 Verifying : gcc-4.4.7-18.el6.x86_64 7/9 Verifying : ppl-0.10.2-11.el6.x86_64 8/9 Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64 9/9 Installed: gcc.x86_64 0:4.4.7-18.el6 Dependency Installed: cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-18.el6 glibc-devel.x86_64 0:2.12-1.209.el6 glibc-headers.x86_64 0:2.12-1.209.el6 kernel-headers.x86_64 0:2.6.32-696.el6 libgomp.x86_64 0:4.4.7-18.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0.10.2-11.el6 Complete! [root@test03 siege-4.0.2]#
再次执行./confgiure
[root@test03 siege-4.0.2]# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... none checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking whether it is safe to define __EXTENSIONS__... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) none checking for a sed that does not truncate output... /bin/sed checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... no checking for c++... no checking for gpp... no checking for aCC... no checking for CC... no checking for cxx... no checking for cc++... no checking for cl.exe... no checking for FCC... no checking for KCC... no checking for RCC... no checking for xlC_r... no checking for xlC... no checking whether we are using the GNU C++ compiler... no checking whether g++ accepts -g... no checking dependency style of g++... none checking for g77... no checking for xlf... no checking for f77... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for xlf90... no checking for f90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for xlf95... no checking for f95... no checking for fort... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgfortran... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool appending configuration tag "F77" to libtool checking for perl... /usr/bin/perl checking for a POSIX-compliant shell... /bin/sh checking whether make sets $(MAKE)... (cached) yes checking for buggy pthread mutex initializers... no checking for dlopen() in -ldld... no checking for dlopen() in -ldl... yes checking for random device... yes checking for ssl support... yes checking /include/openssl/opensslv.h usability... no checking /include/openssl/opensslv.h presence... no checking for /include/openssl/opensslv.h... no checking /usr/include/openssl/opensslv.h usability... no checking /usr/include/openssl/opensslv.h presence... no checking for /usr/include/openssl/opensslv.h... no checking /usr/local/include/openssl/opensslv.h usability... no checking /usr/local/include/openssl/opensslv.h presence... no checking for /usr/local/include/openssl/opensslv.h... no checking /usr/local/ssl/include/openssl/opensslv.h usability... no checking /usr/local/ssl/include/openssl/opensslv.h presence... no checking for /usr/local/ssl/include/openssl/opensslv.h... no checking /usr/pkg/include/openssl/opensslv.h usability... no checking /usr/pkg/include/openssl/opensslv.h presence... no checking for /usr/pkg/include/openssl/opensslv.h... no checking /usr/lib/ssl/include/openssl/opensslv.h usability... no checking /usr/lib/ssl/include/openssl/opensslv.h presence... no checking for /usr/lib/ssl/include/openssl/opensslv.h... no checking /usr/include/ssl/include/openssl/opensslv.h usability... no checking /usr/include/ssl/include/openssl/opensslv.h presence... no checking for /usr/include/ssl/include/openssl/opensslv.h... no checking /usr/include/include/openssl/opensslv.h usability... no checking /usr/include/include/openssl/opensslv.h presence... no checking for /usr/include/include/openssl/opensslv.h... no checking for zlib support... yes checking /include/zlib.h usability... no checking /include/zlib.h presence... no checking for /include/zlib.h... no checking /usr/include/zlib.h usability... no checking /usr/include/zlib.h presence... no checking for /usr/include/zlib.h... no checking /usr/local/include/zlib.h usability... no checking /usr/local/include/zlib.h presence... no checking for /usr/local/include/zlib.h... no checking /usr/local/ssl/include/zlib.h usability... no checking /usr/local/ssl/include/zlib.h presence... no checking for /usr/local/ssl/include/zlib.h... no checking /usr/pkg/include/zlib.h usability... no checking /usr/pkg/include/zlib.h presence... no checking for /usr/pkg/include/zlib.h... no checking /usr/lib/zlib/include/zlib.h usability... no checking /usr/lib/zlib/include/zlib.h presence... no checking for /usr/lib/zlib/include/zlib.h... no checking /usr/include/zlib/include/zlib.h usability... no checking /usr/include/zlib/include/zlib.h presence... no checking for /usr/include/zlib/include/zlib.h... no checking /usr/include/include/zlib.h usability... no checking /usr/include/include/zlib.h presence... no checking for /usr/include/include/zlib.h... no checking for inline... inline checking for int8_t... yes checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for uint8_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for u_int32_t... yes checking for ssize_t... yes checking for ANSI C header files... (cached) yes checking for sys/wait.h that is POSIX.1 compatible... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking for unistd.h... (cached) yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking for sys/types.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/times.h usability... yes checking sys/times.h presence... yes checking for sys/times.h... yes checking sys/resource.h usability... yes checking sys/resource.h presence... yes checking for sys/resource.h... yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking sched.h usability... yes checking sched.h presence... yes checking for sched.h... yes checking openssl/e_os.h usability... no checking openssl/e_os.h presence... no checking for openssl/e_os.h... no checking openssl/e_os2.h usability... no checking openssl/e_os2.h presence... no checking for openssl/e_os2.h... no checking for an ANSI C-conforming const... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking return type of signal handlers... void checking for working alloca.h... yes checking for alloca... yes checking for strchr... yes checking for memcpy... yes checking for strncpy... yes checking for strstr... yes checking for strlen... yes checking for strncasecmp... yes checking for strncmp... yes checking for socket... yes checking for gethostbyname... yes checking for snprintf... yes checking for strdup... yes checking for rand_r... yes checking for localtime_r... yes checking for gmtime_r... yes checking for getipnodebyname... no checking for freehostent... no checking for getopt_long... yes checking for poll... yes checking for socket in -lsocket... no checking for pthread_attr_init in -lpthread... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating doc/Makefile config.status: creating html/Makefile config.status: creating include/Makefile config.status: creating include/joedog/Makefile config.status: creating utils/Makefile config.status: creating include/config.h config.status: executing depfiles commands config.status: executing default-1 commands config.status: executing default-2 commands config.status: executing default-3 commands config.status: executing default-4 commands config.status: executing default-5 commands config.status: executing default-6 commands -------------------------------------------------------- Configuration is complete Run the following commands to complete the installation: make make install For complete documentation: http://www.joedog.org -------------------------------------------------------- [root@test03 siege-4.0.2]#
make
然后执行make
[root@test03 siege-4.0.2]# make Making all in . make[1]: Entering directory `/srv/siege-4.0.2' make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/srv/siege-4.0.2' Making all in include make[1]: Entering directory `/srv/siege-4.0.2/include' make all-recursive make[2]: Entering directory `/srv/siege-4.0.2/include' Making all in joedog make[3]: Entering directory `/srv/siege-4.0.2/include/joedog' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/srv/siege-4.0.2/include/joedog' make[3]: Entering directory `/srv/siege-4.0.2/include' make[3]: Leaving directory `/srv/siege-4.0.2/include' make[2]: Leaving directory `/srv/siege-4.0.2/include' make[1]: Leaving directory `/srv/siege-4.0.2/include' Making all in src make[1]: Entering directory `/srv/siege-4.0.2/src' gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c array.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c auth.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c base64.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c browser.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c cache.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c cookie.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c cookies.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c cfg.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c creds.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c crew.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c data.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c date.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c eval.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c ftp.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c getopt.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c getopt1.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c handler.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c hash.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c http.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c init.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c load.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c log.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c main.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c md5.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c memory.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c notify.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c page.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c parser.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c perl.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c response.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c sock.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c ssl.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c stralloc.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c timer.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c url.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c util.c gcc -DHAVE_CONFIG_H -I. -I../include -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -c version.c /bin/sh ../libtool --tag=CC --mode=link gcc -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -lpthread -o siege array.o auth.o base64.o browser.o cache.o cookie.o cookies.o cfg.o creds.o crew.o data.o date.o eval.o ftp.o getopt.o getopt1.o handler.o hash.o http.o init.o load.o log.o main.o md5.o memory.o notify.o page.o parser.o perl.o response.o sock.o ssl.o stralloc.o timer.o url.o util.o version.o mkdir .libs gcc -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -W -Wall -Wunused-value -g -O2 -o siege array.o auth.o base64.o browser.o cache.o cookie.o cookies.o cfg.o creds.o crew.o data.o date.o eval.o ftp.o getopt.o getopt1.o handler.o hash.o http.o init.o load.o log.o main.o md5.o memory.o notify.o page.o parser.o perl.o response.o sock.o ssl.o stralloc.o timer.o url.o util.o version.o -lpthread make[1]: Leaving directory `/srv/siege-4.0.2/src' Making all in utils make[1]: Entering directory `/srv/siege-4.0.2/utils' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/srv/siege-4.0.2/utils' Making all in doc make[1]: Entering directory `/srv/siege-4.0.2/doc' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/srv/siege-4.0.2/doc' Making all in html make[1]: Entering directory `/srv/siege-4.0.2/html' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/srv/siege-4.0.2/html' [root@test03 siege-4.0.2]#
make install
执行make install
[root@test03 siege-4.0.2]# make install Making install in . make[1]: Entering directory `/srv/siege-4.0.2' make[2]: Entering directory `/srv/siege-4.0.2' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/srv/siege-4.0.2' make[1]: Leaving directory `/srv/siege-4.0.2' Making install in include make[1]: Entering directory `/srv/siege-4.0.2/include' Making install in joedog make[2]: Entering directory `/srv/siege-4.0.2/include/joedog' make[3]: Entering directory `/srv/siege-4.0.2/include/joedog' make[3]: Nothing to be done for `install-exec-am'. make[3]: Nothing to be done for `install-data-am'. make[3]: Leaving directory `/srv/siege-4.0.2/include/joedog' make[2]: Leaving directory `/srv/siege-4.0.2/include/joedog' make[2]: Entering directory `/srv/siege-4.0.2/include' make[3]: Entering directory `/srv/siege-4.0.2/include' make[3]: Nothing to be done for `install-exec-am'. make[3]: Nothing to be done for `install-data-am'. make[3]: Leaving directory `/srv/siege-4.0.2/include' make[2]: Leaving directory `/srv/siege-4.0.2/include' make[1]: Leaving directory `/srv/siege-4.0.2/include' Making install in src make[1]: Entering directory `/srv/siege-4.0.2/src' make[2]: Entering directory `/srv/siege-4.0.2/src' /bin/mkdir -p '/usr/local/bin' /bin/sh ../libtool --mode=install /usr/bin/install -c siege '/usr/local/bin' /usr/bin/install -c siege /usr/local/bin/siege make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/srv/siege-4.0.2/src' make[1]: Leaving directory `/srv/siege-4.0.2/src' Making install in utils make[1]: Entering directory `/srv/siege-4.0.2/utils' make[2]: Entering directory `/srv/siege-4.0.2/utils' make install-exec-hook make[3]: Entering directory `/srv/siege-4.0.2/utils' /bin/sh ../utils/mkinstalldirs /usr/local/bin /bin/sh ../libtool --mode=install /usr/bin/install -c bombardment /usr/local/bin/bombardment /usr/bin/install -c bombardment /usr/local/bin/bombardment /bin/sh ../libtool --mode=install /usr/bin/install -c siege2csv.pl /usr/local/bin/siege2csv.pl /usr/bin/install -c siege2csv.pl /usr/local/bin/siege2csv.pl /bin/sh ../libtool --mode=install /usr/bin/install -c siege.config /usr/local/bin/siege.config /usr/bin/install -c siege.config /usr/local/bin/siege.config make[3]: Leaving directory `/srv/siege-4.0.2/utils' make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/srv/siege-4.0.2/utils' make[1]: Leaving directory `/srv/siege-4.0.2/utils' Making install in doc make[1]: Entering directory `/srv/siege-4.0.2/doc' make[2]: Entering directory `/srv/siege-4.0.2/doc' make install-exec-hook make[3]: Entering directory `/srv/siege-4.0.2/doc' make[3]: Leaving directory `/srv/siege-4.0.2/doc' /bin/mkdir -p '/usr/local/share/man/man1' /usr/bin/install -c -m 644 siege.1 siege.config.1 bombardment.1 siege2csv.1 '/usr/local/share/man/man1' make[2]: Leaving directory `/srv/siege-4.0.2/doc' make[1]: Leaving directory `/srv/siege-4.0.2/doc' Making install in html make[1]: Entering directory `/srv/siege-4.0.2/html' make[2]: Entering directory `/srv/siege-4.0.2/html' make install-exec-hook make[3]: Entering directory `/srv/siege-4.0.2/html' HTML pages not installed make[3]: Leaving directory `/srv/siege-4.0.2/html' make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/srv/siege-4.0.2/html' make[1]: Leaving directory `/srv/siege-4.0.2/html' [root@test03 siege-4.0.2]#
验证Siege是否安装成功
使用siege -V查看版本信息
[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查看帮助信息
[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已经安装了~
一个示例
安装完毕之后,没有示例怎么行,下面就给一个示例示范一下。
示例 ==> 并发请求指定URL http://download.joedog.org/
siege -c 5 -r 2 http://download.joedog.org/
参数说明: -c 是并发量,并发数为5,-r 是重复次数, 重复2次
[root@test03 siege-4.0.2]# siege -c 5 -r 2 http://download.joedog.org/ [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.47 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.48 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.49 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.49 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.52 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.40 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.43 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.44 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.45 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.42 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.43 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 0.43 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 0.41 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 0.46 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 0.46 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 0.37 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.41 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.44 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.42 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.45 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.45 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.42 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.43 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.42 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 0.40 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 0.43 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 0.43 secs: 2455 bytes ==> GET /images/pommie-icon.gif HTTP/1.1 200 2.25 secs: 4583 bytes ==> GET / HTTP/1.1 200 0.44 secs: 225 bytes ==> GET /icons/folder.gif HTTP/1.1 200 0.46 secs: 2455 bytes ==> GET /images/pommie-icon.gif Transactions: 30 hits Availability: 100.00 % Elapsed time: 4.67 secs Data transferred: 0.07 MB Response time: 0.50 secs Transaction rate: 6.42 trans/sec Throughput: 0.01 MB/sec Concurrency: 3.21 Successful transactions: 30 Failed transactions: 0 Longest transaction: 2.25 Shortest transaction: 0.37 [root@test03 siege-4.0.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 ## 每次传输所花最短时间
至此,CentOS安装Web性能测试工具Siege,并给出一个简单的示例就完成了。
后续,将给出Siege不同参数的使用实例,更多地去了解Siege~