하드웨어 부하테스트 (Stress)

Posted by 주원이^^
2016. 7. 13. 10:39 리눅스/소프트웨어(Software)
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

LinuxStress 툴의 설치 및 사용방법

                                                                             작성자: 신 동 인

 

1. Kit확보방법

 - 아래의 url에서 source download 받음.

   http://weather.ou.edu/~apw/projects/stress/

   stress-1.0.0.tar.gz

 

2. ftp를 사용하여 원하는 시스템의 디렉토리로 이동

 

3. 압축의 해제

[root@krcipf3 stress]# tar -xzvf stress-1.0.0.tar.gz

stress-1.0.0/

stress-1.0.0/README

stress-1.0.0/configure.in

stress-1.0.0/aclocal.m4

stress-1.0.0/Makefile.am

stress-1.0.0/Makefile.in

stress-1.0.0/configure

stress-1.0.0/AUTHORS

stress-1.0.0/COPYING

stress-1.0.0/ChangeLog

stress-1.0.0/INSTALL

stress-1.0.0/NEWS

stress-1.0.0/TODO

stress-1.0.0/depcomp

stress-1.0.0/install-sh

stress-1.0.0/missing

stress-1.0.0/src/

stress-1.0.0/src/Makefile.am

stress-1.0.0/src/Makefile.in

stress-1.0.0/src/stress.c

stress-1.0.0/doc/

stress-1.0.0/doc/Makefile.am

stress-1.0.0/doc/Makefile.in

stress-1.0.0/doc/stamp-vti

stress-1.0.0/doc/version.texi

stress-1.0.0/doc/mdate-sh

stress-1.0.0/doc/texinfo.tex

stress-1.0.0/doc/stress.texi

stress-1.0.0/doc/stress.1

stress-1.0.0/doc/stress.html

stress-1.0.0/doc/stress.info

stress-1.0.0/test/

stress-1.0.0/test/Makefile.am

stress-1.0.0/test/Makefile.in

stress-1.0.0/test/check_version_return_code

stress-1.0.0/test/check_usage_return_code

 

4. 소스의 컴파일

[root@krcipf3 stress-1.0.0]# ./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 for gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables...

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 for style of include used by make... GNU

checking dependency style of gcc... gcc3

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 for unistd.h... (cached) yes

checking for sqrt in -lm... yes

checking for basename in -lgen... no

configure: creating ./config.status

config.status: creating Makefile

config.status: creating src/Makefile

config.status: creating doc/Makefile

config.status: creating test/Makefile

config.status: executing depfiles commands

[root@krcipf3 stress-1.0.0]# make

Making all in .

make[1]: Entering directory `/shindi/tools/stress/stress-1.0.0'

make[1]: `all-am'를 위해 할 일이 없습니다

make[1]: Leaving directory `/shindi/tools/stress/stress-1.0.0'

Making all in src

make[1]: Entering directory `/shindi/tools/stress/stress-1.0.0/src'

gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"stress\" -DVERSION=\"1.0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBM=1 -I.     -Wall -Werror -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -MT stress.o -MD -MP -MF .deps/stress.Tpo -c -o stress.o stress.c

mv -f .deps/stress.Tpo .deps/stress.Po

gcc  -Wall -Werror -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE   -o stress stress.o  -lm

[root@krcipf3 stress-1.0.0]#

 

 

5. 실행파일 생성 확인

[root@krcipf3 stress-1.0.0]#

[root@krcipf3 stress-1.0.0]# cd src

[root@krcipf3 src]# ls -l stress

-rwxr-xr-x  1 root root 51993 10 21 16:50 stress

 

6. 실행테스트

[root@krcipf3 src]# ./stress --cpu 8 --timeout 60s  

   <-- 8 cpu에 돌아가는 것으로 8개 프로세스가 구동됨.

stress: info: [6950] dispatching hogs: 8 cpu, 0 io, 0 vm, 0 hdd

 

[root@krcipf3 ~]# vmstat 5

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----

 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa

 9  0      0 3681888  47760 226752   0    0     0     7 2075    51 100  0  0  0

 9  0      0 3681952  47760 226752   0    0     0     0 2066    44 100  0  0  0

 9  0      0 3679776  47776 226736   0    0     0     6 2082    77 100  0  0  0

 9  0      0 3679200  47808 226704   0    0     0    31 2069    56 100  0  0  0

 9  0      0 3679200  47808 226704   0    0     0     0 2070    46 100  0  0  0

 

 

[root@krcipf3 src]# ./stress --vm 3 --vm-bytes 1024m  --timeout 60s

   <--  Memory load를 위해 2개의 process 1024M의 메모리를 사용

stress: info: [7147] dispatching hogs: 0 cpu, 0 io, 3 vm, 0 hdd

stress: info: [7147] successful run completed in 60s

[root@krcipf3 src]#

 

[root@krcipf3 ~]# vmstat 5

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----

 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa

 4  0   8160 1452224  1952  22768    0    0     0     0 2063    48  7 93  0  0

 4  0   8160 3379968  1968  22752    0    0    26     0 2070    57  9 91  0  0

 4  0   8160 1816640  2016  24768    0    0    13     1 2066    87  7 93  0  0

 4  0   8160 2700224  2048  24736    0    0     0    34 2068    58  8 92  0  0

 4  0   8160 2366528  2048  24736    0    0     0     0 2061    53  7 93  0  0

 

[root@krcipf3 src]# stress --hdd 3 --hdd-bytes 1024m --timeout 60s

   <-- hard disk load를 위한 process수와 hard disk 테스트를 위한 파일의 크기를 정의

stress: info: [7301] dispatching hogs: 0 cpu, 0 io, 0 vm, 3 hdd

stress: info: [7301] successful run completed in 77s

[root@krcipf3 src]#

 

[root@krcipf3 ~]# vmstat 5

procs -----------memory---------- ---swap-- -----io----- --system-- ----cpu----

 r  b   swpd   free   buff  cache   si   so    bi     bo   in    cs us sy id wa

 0  5   8144 1914144  10448 1962576  0    0     5  11856 2200  1441  0 36  0 64

 4  5   8144 1600832  11664 2258576  0    0     2  70411 2211  1848  0 15  0 85

 0  7   8144 1090816  13600 2735488  0    0     3 226435 2204  1618  0 28  0 72

 0  7   8144 1929664  15152 1908336  0    0     3      0 2208  1742  0 20  0 80

 1  7   8144 2773504  15376 1101088  0    0     2     26 2205  1924  0 11  0 89

 

[root@krcipf3 src]# ./stress --cpu 5 --vm 3 --vm-bytes 512m --hdd 2 --hdd-bytes 1024m  --timeout 60s 

   <-- cpu, memory, and disk를 모두 테스트

stress: info: [7584] dispatching hogs: 5 cpu, 0 io, 3 vm, 2 hdd

stress: info: [7584] successful run completed in 64s

[root@krcipf3 src]#

 

[root@krcipf3 ~]# vmstat 5

procs -----------memory---------- ---swap-- -----io----  --system-- ----cpu----

 r  b   swpd   free   buff  cache   si   so    bi     bo   in    cs us sy id wa

11  4   8080 1430528  55952 1632048  0    0     0 143647 2197   762 50 50  0  0

10  5   8064 1131328  57680 1584928  0    0     0     20 2192    87 57 43  0  0

 9  4   8064 2387008  58048 472064   0    0     1 109312 2198    80 60 40  0  0

12  2   8064 2334624  58320 162192   0    0     0      2 2193    81 63 37  0  0

11  4   8064 1933120  60688 682016   0    0     0 129394 2143   131 55 45  0  0

 

시간: s,m,h,d,y     크기:k,m,g

 

7. stress툴의 사용방법관련 정보

# info stress 를 실행하면 사용방법에 대한 자세한 정보를 볼 수 있음.

 

 

'리눅스 > 소프트웨어(Software)' 카테고리의 다른 글

scp 쓰는법  (0) 2017.01.31
DNS 설치  (0) 2017.01.31
LVS Server2  (0) 2016.04.08
LVS Server1  (0) 2016.04.08
리눅스 본딩셋팅  (0) 2015.09.14