2012.04.20 20:27
새로운 서버 또는 시스템 구축 후에 과연 이게 얼마나 버텨줄까 라는 의구심이 드는게 사실 입니다.
스펙이 아무리 좋아도 설정상의 문제가 있어 부하를 견디지 못하는 현상이 발생 할 수 있습니다.
예를 들어 apache session 설정이 낮게 되어 있어 자원은 남아있지만, 세션이 가득차서 장애가 발생하는 경우,Nginx 의 경우 core 개수를 지정하지 않아 4개의 core가 있음에도 1개의 코어만 사용해서 부하가 발생하는 경우 등등
위와 같은 미처 확인하지 못한 장애가 서비스를 시작한 이후에 발견 된다면, 참 난감한 일이 아닐 수 없습니다.
2편으로 나누어 부하 테스트 툴에 대한 포스팅을 진행 합니다.
1편 - 하드웨어 부하 테스트 툴
2편 - 웹 부하 테스트 툴 (ab)
1.하드웨어 부하 테스트 툴
Download
http://dag.wieers.com/rpm/packages/stress
위 url 에서 버전에 맞는 rpm 파일을 다운 받습니다.
Ex) Cent 5.x 32bit를 기준으로 작성
서버에서 직접 다운로드.
[hostway] /home/src > # wget http://pkgs.repoforge.org/stress/stress-1.0.2-1.el5.rf.i386.rpm
RPM 설치
[hostway] /home/src > # rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
스트레스 tool 실행
[hostway] /home/src > # stress --cpu 2 --io 4 --vm 2 --hdd 1 --timeout 10s
백그라운드로 실행 후 확인 하려는 경우
[hostway] /home/src > # stress --cpu 2 --io 4 --vm 2 --hdd 1 --timeout 10s &
위 값을 조절해서 테스트 진행 하시기 바라며, 너무 큰 값을 넣게 되면 서버가 다운될 수 있으니 주의.
자세한 옵션 사용법은 info stress 참조.
스트레스 tool 사용법 및 설명
[hostway] /home/src > info stress
3 Example invocations
*********************
The simple case is that you just want to bring the system load average
up to an arbitrary value. The following forks 13 processes, each of
which spins in a tight loop calculating the sqrt() of a random number
acquired with rand().
% `stress -c 13'
Long options are supported, as well as is making the output less
verbose. The following forks 1024 processes, and only reports error
messages if any.
% `stress --quiet --cpu 1k'
To see how your system performs when it is I/O bound, use the -i
switch. The following forks 4 processes, each of which spins in a
tight loop calling sync(), which is a system call that flushes memory
buffers to disk.
% `stress -i 4'
Multiple hogs may be combined on the same command line. The
following does everything the preceding examples did in one command,
but also turns up the verbosity level as well as showing how to cause
the command to self-terminate after 1 minute.
% `stress -c 13 -i 4 --verbose --timeout 1m'
You can write a file of arbitrary length to disk. The file is
created with mkstemp() in the current directory, the default is to
unlink it, but unlinking can be overridden with the -hdd-noclean flag.
% `stress -d 1 --hdd-noclean --hdd-bytes 13'
Large file support is enabled.
% `stress -d 1 --hdd-noclean --hdd-bytes 3G'
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
386 | cdp 백업 프로세스 관련 | 호스트웨이 | 2015.09.07 | 1007 |
385 | Linux vmstat 명령어 | 호스트웨이 | 2015.09.08 | 1094 |
384 | 현재 접속 사용자(머신/디바이스)수 알아내기 | 호스트웨이 | 2012.11.16 | 1130 |
383 | 잘못푼 압축파일(tar.gz) 지우는 방법 | 호스트웨이 | 2012.12.07 | 1273 |
382 | sftp 서비스 막기 | 호스트웨이 | 2012.12.27 | 1321 |
381 | 우분투 서버에 JDK7 설치하기 | 호스트웨이 | 2015.09.13 | 1360 |
380 | Linux 외장 저장장치 mount | 호스트웨이 | 2015.09.10 | 1397 |
379 | 2015년 7월1일 윤초 발생 관련 점검 방안 | 호스트웨이 | 2015.06.30 | 1558 |
378 | 리눅스 whereis 명령어 | 호스트웨이 | 2012.09.28 | 1634 |
377 | Log file 주기적으로 정리하기 | 호스트웨이 | 2015.09.08 | 1644 |
376 | 특정 파일이 소속된 rpm 패키지 찾기 | 호스트웨이 | 2012.12.14 | 1783 |
375 | arch 명령어를 통해 컴퓨터 종류 알기 | 호스트웨이 | 2012.11.16 | 1797 |
374 | 리눅스 free 명령어 | 호스트웨이 | 2012.12.26 | 1819 |
373 | locate 명령어를 이용해 빠르게 지정한 파일 찾기 | 호스트웨이 | 2012.12.12 | 1859 |
372 | queryperf 설치 및 사용 방법 (DNS 스트레스 테스트) | 호스트웨이 | 2012.11.29 | 1871 |
371 | kbd_mode 명령어를 통해 인식중인 키보드모드 출력 및 변경하기 | 호스트웨이 | 2012.11.06 | 1896 |
370 | /proc 디렉터리내 파일 정보 알아보기 | 호스트웨이 | 2012.11.21 | 1918 |
369 | top 사용 추가 tip | 호스트웨이 | 2015.09.15 | 2017 |
368 | limits.conf 설명 | 호스트웨이 | 2012.11.09 | 2133 |
367 | free -m 에서 free (남는 메모리 양) 최소량 제한하기 | 호스트웨이 | 2012.12.21 | 2147 |