Last Updated on 2014年8月8日 by かんりにん
カーネル負荷テストツール(LTP)
IBM、SGI、OSDLなどが共同で運営しているLinux Test Project(ltp)の提供するツール
を使ってサーバへの負荷テストを行う。
【参照サイト】
お世話になっています。
Linuxカーネルのストレス・テスト
http://www-06.ibm.com/jp/developerworks/linux/040709/j_l-stress.html
Linux Test Project
http://ltp.sourceforge.net/
http://jaist.dl.sourceforge.net/sourceforge/ltp/ltp-full-20060615.tgz
Red Hat Linux/サポート:ltpの機能拡張アップデート
http://www.jp.redhat.com/support/errata/RHEA/RHEA-2005-873J.html
※Red Hat Enterprise Linux ASにはRPMがある様子。
【テストに使った環境】
OS CentOS4.0(仮想環境)
CPU Intel Pen4 2.80GHz
mem 1024MB
うち割り当て320MB(swap640MB)
ダウンロードと展開
[root@example src]# pwd /usr/local/src [root@example src]# wget http://jaist.dl.sourceforge.net/sourceforge/ltp/ltp-full-20060615.tgz [root@example src]# tar -zxvf ltp-full-20060615.tgz [root@example src]# cd ltp-full-20060615
コンパイルとインストール
- インストール条件
- 以下のユーザ、及びグループが存在していること。
nobody
bin
daemon - またそれぞれUIDとGIDが同じIDを持っていること。
たとえばdaemonの場合はdaemon:x:2:2:daemon:/sbin:/sbin/nologin
となる。
- 以下のユーザ、及びグループが存在していること。
- 以下のグループが存在していること
sys
users
条件をクリアしていたらインストールはOK。
[root@example ltp-full-20060615]# make [root@example ltp-full-20060615]# make instal
make installを実行すると、スクリプトの実行に必要となるユーザ/グループのIDを
最後にチェックする。
Checking for required user/group ids Nobody user id and group exist. Bin user id and group exist. Daemon user id and group exist. Users group exists. Sys group exists. Required users/groups exist. [root@example ltp-full-20060615]#
テストシェルの実行
runalltest.shまたはrunltplite.shを実行してみる。
最初にfreeの出力結果やcpuinfoが表示された後、テストが開始される。
[root@example ltp-full-20060615]# ./runalltests.sh ******************************************************************* ******************************************************************* ** ** ** The runalltests.sh script is being phased out soon. It will ** ** be replaced with the scripts called 'runltp'. If you ** ** currently rely on this script for automation scripts, you ** ** should think about changing them NOW! ** ** ** ******************************************************************* ******************************************************************* INFO: no command files were provided, using default, system calls, memory management, IPC, scheduler direct io, file system, math and pty tests will now be executed If some fields are empty or look unusual you may have an old version. Compare to the current minimal requirements in Documentation/Changes. CentOS release 4.3 (Final) Linux test2 2.6.9-34.EL #1 Wed Mar 8 00:07:35 CST 2006 i686 i686 i386 GNU/Linux Gnu C gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2) Gnu make 3.80 util-linux 2.12a mount 2.12a modutils 3.1-pre5 e2fsprogs 1.35 pcmcia-cs 3.2.7 PPP 2.4.2 isdn4k-utils 3.3 Linux C Library 2.3.4 Dynamic linker (ldd) 2.3.4 Procps 3.2.3 Net-tools 1.60 Kbd 1.12 Sh-utils 5.2.1 Modules Loaded ipt_state ip_conntrack iptable_filter ip_tables md5 ipv6 autofs4 dm_multipath button battery ac pcnet32 mii floppy dm_snapshot dm_zero dm_mirror ext3 jbd dm_mod mptscsih mptsas mptspi mptfc mptscsi mptbase sd_mod scsi_mod free reports: total used free shared buffers cached Mem: 320984 292512 28472 0 63324 169208 -/+ buffers/cache: 59980 261004 Swap: 655352 144 655208 /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 4 model name : Intel(R) Pentium(R) D CPU 2.80GHz stepping : 8 cpu MHz : 2788.474 cache size : 1024 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 5 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx pni ds_cpl bogomips : 5598.30 <<<test_start>>> tag=abort01 stime=1151475512 cmdline="ulimit -c 1024;abort01" contacts="" analysis=exit initiation_status="ok" <<<test_output>>> abort01 1 PASS : Test passed <<<execution_status>>> duration=0 termination_type=exited termination_id=0 corefile=no cutime=0 cstime=5 <<<test_end>>> accept01 1 PASS : bad file descriptor successful ----中略---
スクリプトはctrl+Cで中断できる。
中断時は以下のメッセージとバージョンが表示される。
<<<test_end>>> INFO: pan reported some tests FAIL LTP Version: LTP-20060615 #
所見
どんなテストを行うかはドキュメントを確認するとして、実行中は
runalltest.shではLAが一時7~8程度まで上がるほど高負荷がかかった。
runltplite.shだとLAが27~30まで上昇(!!)した。
マニュアルに実行されるコマンドや実行例があるので、要確認。