Real Alternative DBMS ALTIBASE, Since 1999 문제분석을위한 OS 별유틸리티사용가이드 2010. 02 Copyright c 2000~2013 ALTBASE Corporation. All Rights Reserved.
Document Control Change Record Date Author Change Reference 2010-02-24 lim272 Created Reviews Date Name (Position) Distribution Name Location 문제분석을위한 OS 별유틸리티사용가이드 2 page of 18
목차 개요... 4 공통명령어... 5 netstat... 5 vmstat... 5 SUN... 6 prstat... 6 pstack... 6 pfiles... 9 시스템로그... 10 AIX... 11 ps... 11 procstack... 11 procfiles... 12 errpt... 12 HP-UX... 13 glance 를통한 Thread 별 CPU 사용량... 13 pstack... 13 pfiles... 14 시스템로그... 14 LINUX... 16 Thread 별 CPU 사용량... 16 pstack... 16 사용중인파일목록확인... 17 시스템로그... 17 문제분석을위한 OS 별유틸리티사용가이드 3 page of 18
개요 DBMS 와연관된기술지원을하게되면 ALTIBASE 가제공하는성능뷰만으로는문제해결을위한정보가부족한경우들이있다. 이때운영체제에서제공하는몇가지명령어를이용하여필요한정보를획득할수있는데본문서에서그와관련된명령어들을설명한다. 문제분석을위한 OS 별유틸리티사용가이드 4 page of 18
공통명령어 모든운영체제에실행이가능한특별히제약을갖지않는공통적인명령어를설명한다. netstat 네트웍설정이나오류패킷여부가존재하는지확인한다. Shell> netstat in Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue lo0 8232 127.0.0.0 127.0.0.1 2314073378 0 2314073378 0 0 0 ce0 1500 192.168.1.0 192.168.1.60 501973072 0 1690153823 0 0 0 패킷상의송수신간에문제가발생할경우 Ierrs/Oerrs/Collis 등이수치가증가된다. 이경우는네트웍상에어떤문제가있을수있음으로관리자로하여금점검하도록조치한다. vmstat 시스템의메모리, 디스크, swap in/out, CPU 의상태등을전반적으로사용자가정한간격으로조회할수있다. Shell> vmstat 1 5 (1 초단위로 5 번을화면에출력 ) kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr m1 rm s6 sd in sy cs us sy id 4 0 253 18600904 3703904 471 6104 110 36 39 0 10 25-0 -0-9 15845 92177 31495 24 17 60 4 0 2098 11390376 2018056 622 10532 155 15 15 0 0 3 0 0 0 23252 46363 40809 34 24 42 0 0 2098 11390376 2019160 622 11288 16 88 88 0 0 5 0 0 0 22014 67475 39977 33 24 44 0 0 2098 11390376 2019416 667 11337 0 8 8 0 0 2 0 0 0 22958 175682 40640 31 27 42 0 2 2098 11390280 2019840 691 11385 0 88 80 0 0 39 0 0 0 22573 185484 41354 33 28 39 확인할주요지표는다음과같다. 항목 Kthr의 r Memory의 free Page의 fr, sr 설명 CPU 를점유하기위해대기하는쓰레드의개수이며값이크다면 CPU 병목이발생한다고판단할수있다. 물리적메모리상의여유공간 Fr, sr 의수치가증가한다는것은메모리부족에의해메모리를확보하기위한 victim 페이지에대한 scan 및디스크 I/O 가발생한다는의미이다. CPU 의모든항목각항목별로변화추이를살펴야한다. 문제분석을위한 OS 별유틸리티사용가이드 5 page of 18
SUN prstat ALTIBASE 는쓰레드구조로개발되어있으며경우에따라어떤쓰레드가 CPU 를많이점유하고사용하는지확인해야하는경우사용한다. Shell> prstat L p <process id> <refresh interval> Ex) prstat L p 22951 1 (22951 프로세스를 1 초단위로보겠다는의미 ) PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID 22951 lim272 502M 106M sleep 59 0 0:22:50 1.7% altibase/5 22951 lim272 502M 106M sleep 59 0 0:23:49 0.3% altibase/4 22951 lim272 502M 106M sleep 59 0 0:00:10 0.1% altibase/12 22951 lim272 502M 106M sleep 59 0 0:00:05 0.1% altibase/47 22951 lim272 502M 106M sleep 59 0 0:25:28 0.0% altibase/6 22951 lim272 502M 106M sleep 59 0 0:22:19 0.0% altibase/9 22951 lim272 502M 106M sleep 59 0 0:23:13 0.0% altibase/8 항목 CPU LWPID 설명 해당쓰레드가 CPU 를현재사용하는 CPU 점유율 쓰레드의고유번호 pstack prstat 과같이쓰레드의 CPU 점유를확인하면쓰레드가현재어떤부분을수행중인지확인하는방법으로사용한다. Shell> pstack F <process pid> c++filt ----------------- lwp# 7 / thread# 7 -------------------- ffffffff7e1d9ce8 pollsys (ffffffff7b4ffa50, 0, ffffffff7b4ffb10, 0) ffffffff7e173c44 pselect (0, ffffffff7b4ffa50, ffffffff7e344710, ffffffff7e344710, ffffffff7b4ffb10, 0) + 1f0 ffffffff7e173fe8 select (0, 106eea070, 0, 0, ffffffff7b4ffbd8, fffc00) + a0 00000001006f6df4 IDE_RC cmndispatcherselectsock(cmndispatcher*,idulist*,unsigned*,pdl_time_value*) (106eea040, ffffffff7b4ffd88, 0, 106cc5818, ffffffff, 106eea070) + 50 00000001006f089c IDE_RC 문제분석을위한 OS 별유틸리티사용가이드 6 page of 18
cmiselectdispatcher(cmndispatcher*,idulist*,unsigned*,pdl_time_value*) (106eea040, ffffffff7b4ffd88, 0, 106cc5818, ffffffffffffffff, 1006f6da4) + 1c 0000000100140790 void mmtservicethread::findreadytask() (106cc56d8, 105966f18, 101000, 0, 2710, 0) + 14 000000010013f878 void mmtservicethread::run() (106cc56d8, 1, ffffffffffffffff, 2ec6bb9, 101329000, 10132b000) + 560 0000000100717034 void*idtbasethread::staticrunner(void*) (106cc56d8, 100000, 0, 0, 100a120c8, 10013f318) + 14 ffffffff7e1d609c _lwp_start (0, 0, 0, 0, 0, 0) ----------------- lwp# 8 / thread# 8 -------------------- 000000010056581c IDE_RC smllockmgr::locktable(int,smllockitem*,smllockmode,unsigned long,smllockmode*,idbool*,smllocknode**,smllockslot**) (11b2176c0, 102e8cd50, 200, 7, 11644ea00, 7) 000000010067ac5c IDE_RC smitablecursor::open(smistatement*,const void*,const void*,unsigned long,const smicolumnlist*,const smirange*,const smirange*,const smicallback*,unsigned,smicursortype,smicursorproperties*) (11b2176c0, ffffffff7b2fdc70, 11644e9e8, 0, 155cec, 0) + 38c 00000001001e6f2c IDE_RC qmcinsertcursor::opencursor(smistatement*,unsigned,smicursorproperties*) (ffffffff7b2fdb18, ffffffff7b2fdc70, 1, ffffffff7b2fdb38, 0, 0) + 64 000000010023e0a8 IDE_RC qmx::executeinsertvalues(qcstatement*) (106ea13c8, 106ea14b8, 11b1e81f8, 6200, 0, 10023de38) + 270 0000000100269cec IDE_RC qsxexecutor::execnonselectdml(qsxexecutorinfo*,qcstatement*,qsprocstmts*) (ffffffff7b2fec78, 106ea13c8, 10469b2c8, 106cb1978, 1000000000, 1) + 3f0 00000001002698a8 IDE_RC qsxexecutor::execinsert(qsxexecutorinfo*,qcstatement*,qsprocstmts*) (ffffffff7b2fec78, 106ea13c8, 10469b2c8, 1, 101135000, ffffffffffffffff) + c 0000000100268344 IDE_RC qsxexecutor::execstmtlist(qsxexecutorinfo*,qcstatement*,qsprocstmts*,idbool) (ffffffff7b2fec78, 106ea13c8, 10469b2c8, 100268290, 0, 11b2117e0) + 6c 000000010026b914 IDE_RC qsxexecutor::execfor(qsxexecutorinfo*,qcstatement*,qsprocstmts*) (ffffffff7b2fec78, 106ea13c8, 11b1df798, 1, 106ef0b88, 1) + 58c 0000000100268344 IDE_RC qsxexecutor::execstmtlist(qsxexecutorinfo*,qcstatement*,qsprocstmts*,idbool) (ffffffff7b2fec78, 106ea13c8, 11b1df798, 100268290, 0, 8080808080808080) + 6c 0000000100267da8 IDE_RC qsxexecutor::execblock(qsxexecutorinfo*,qcstatement*,qsprocstmts*) (ffffffff7b2fec78, 106ea13c8, 11b231478, 0, 0, 106ef0b88) + d4 0000000100267054 IDE_RC qsxexecutor::execplan(qsxexecutorinfo*,qcstatement*,mtcstack*,int,qmccursor*,qmcdtemptable Mgr*) (ffffffff7b2fec78, 106ea13c8, 11b211840, 106ea14b8, ffffffff7b2fede0, 1) + 348 0000000100262ecc IDE_RC qsx::callprocwithstack(qcstatement*,qsprocparsetree*,mtcstack*,int,qmccursor*,qmcdtemptabl emgr*,qctemplate*) (106ea13c8, 11b231518, 11b1fe458, 3ff, ffffffff7b2fede0, ffffffff7b2fedc8) + 78 000000010026299c IDE_RC qsx::executeprocorfunc(qcstatement*) (106ea13c8, 0, 28, 101225, 0, 0) 문제분석을위한 OS 별유틸리티사용가이드 7 page of 18
+ 1e0 0000000100169528 IDE_RC qci::execute(qcistatement*,smistatement*) (106ea13c8, 0, 34247000, 28, 4, 100a12f7c) + 2d8 000000010015bfc0 IDE_RC mmcstatement::executesp(mmcstatement*,long*) (106ea0db8, ffffffff7b2ffcd0, 0, 0, 34249000, ffffffffffffffff) + c 0000000100158cec IDE_RC mmcstatement::execute(long*) (100a12000, ffffffff7b2ffcd0, 100a12, 106ea0db8, 20, 101325000) + bc 0000000100146f28 IDE_RC doexecute(mmtcmsexecutecontext*) (ffffffff7b2ffcc0, 106cb16c8, 1, ffffffff7b2ffcd0, 106ea13c8, 2) + 40 00000001001479ac IDE_RC mmtservicethread::executeprotocol(cmiprotocolcontext*,cmpprotocol*,void*,void*) (106e28940, 106e28990, 106e28900, 106cc5580, 1a, 7fffffff) + c4 00000001006f1ec0 IDE_RC cmireadprotocolandcallback(cmiprotocolcontext*,void*,pdl_time_value*) (106e28940, 106cc5580, 0, 101205ed8, 0, 0) + 90 000000010013f4ec void mmtservicethread::run() (106cc5580, 1, 106e28940, 101325000, 2400, 10132b000) + 1d4 0000000100717034 void*idtbasethread::staticrunner(void*) (106cc5580, 100000, 0, 0, 100a120c8, 10013f318) + 14 ffffffff7e1d609c _lwp_start (0, 0, 0, 0, 0, 0) c++filter 라는명령은 C/C++ 간에호출된함수명이제대로보여지지않는경우를제거하는용도이다. 사용하지않을경우함수명이보기힘든형태로출력됨으로가능한사용하도록하며일반적으로컴파일러가설치된경로의실행파일이위치하는곳에존재한다. (Ex: /opt/sunwspro/bin/) 위결과는모두쓰레드별로출력되기때문에각쓰레드별로구분하고단락내에서는가장아래부터위로확인한다. 위의예제에서 LWP#8 번은다음과같은순서이다. 항목 Lwp_start staticrunner 설명 쓰레드의생성및개시 run cmireadprotocolandcallback mmtservicethread::executeprotocol doexecute mmcstatement::execute(long mmcstatement::executesp 통신상에서사용자의질의요청을읽었음 실행단계로진입 프로시져수행요구임을확인 qci::execute qsx::executeprocorfunc qsx::callprocwithstack 문제분석을위한 OS 별유틸리티사용가이드 8 page of 18
qsxexecutor::execblock qsxexecutor::execstmtlist qsxexecutor::execinsert qsxexecutor::execnonselectdml qmx::executeinsertvalues qmcinsertcursor::opencursor smitablecursor::open smllockmgr::locktable 해당프로시져내에서 Insert문수행을확인 Insert문이실행 MVCC와관련된내부커서를열음테이블에 Lock을획득 위의결과와같이 prstat/pstack 의정보를조합하면 CPU 를가장많이사용하는특정쓰레드가어떤일을수행중인지확인이가능하다. 또한, 많은 SQL 문중에위의 pstack 결과를통해좀더범위를좁힌추적을가능하게할수있다. pfiles pfiles는프로세스가사용중인모든파일목록을보여준다. Shell> pfiles F <process id> 22951: /home2/lim272/work/altibase_home/bin/altibase -p boot from admin Current rlimit: 65535 file descriptors 0: S_IFREG mode:0644 dev:118,38 ino:3309572 uid:124 gid:1 size:202128 O_WRONLY O_APPEND O_CREAT O_LARGEFILE /home2/lim272/work/altibase_home/trc/altibase_boot.log 1: S_IFREG mode:0644 dev:118,38 ino:3309573 uid:124 gid:1 size:1413256 O_WRONLY O_APPEND O_CREAT O_LARGEFILE /home2/lim272/work/altibase_home/trc/altibase_sm.log 위의결과에서현재사용가능한 file descriptor 정보와함께 0 번, 1 번순으로해당프로세스가접근하여사용중인모든파일들을보여준다. 여러세션들이접속된상태에서 pfiles 를수행하면데이터파일, 트레이스로그, 트랜잭션로그파일외에도통신연결목록까지모두보여준다. 321: S_IFSOCK mode:0666 dev:329,0 ino:63732 uid:0 gid:0 size:0 O_RDWR O_NONBLOCK SOCK_STREAM SO_REUSEADDR,SO_KEEPALIVE,SO_SNDBUF(65536),SO_RCVBUF(32788),IP_NEXTHOP(0.0.1 28.20) sockname: AF_INET 127.0.0.1 port: 27584 문제분석을위한 OS 별유틸리티사용가이드 9 page of 18
peername: AF_INET 127.0.0.1 port: 42567 시스템로그 기술지원시간혹외부에서원인을찾아보아야할경우 SUN 은 /var/adm/messages.* 파일들을확인하도록한다. 파일의확장자는로그가기록된주를의미하며오늘을포함한주간의로그는 messages 파일에기록된다. Shell> vi /var/adm/messages Feb 24 18:08:24 v880 Corrupt label; wrong magic number Feb 24 18:08:24 v880 scsi: [ID 107833 kern.warning] WARNING: /pci@9,700000/fibrechannel@4/fp@0,0/ssd@w210000d023041a42,7 (ssd13): Feb 24 18:08:24 v880 Corrupt label; wrong magic number Feb 24 18:08:24 v880 scsi: [ID 107833 kern.warning] WARNING: /pci@9,700000/fibrechannel@4/fp@0,0/ssd@w210000d023041a42,7 (ssd13): Feb 24 18:08:24 v880 Corrupt label; wrong magic number 시스템로그는각벤더의전문가가아닌이상명확하게이해하기어렵지만장애등으로기술지원을할때특정시각에의미있는로그가있다면반드시확인하도록한다. 문제분석을위한 OS 별유틸리티사용가이드 10 page of 18
AIX AIX 5.1 이전에서는특정명령어들은지원되지않을수있다. ps SUN의 prstat과동일한결과를확인할수있다. Shell> ps mo THREAD p <process id> USER PID PPID TID ST CP PRI SC WCHAN F TT BND COMMAND lim272 757988 1 - A 119 60 35 40001 - - lim272/work/alti - - - 1540169 S 0 60 1 f100070f10017840 8c10400 - - - - - - 1708137 S 0 60 1-410410 - - - - - - 1749229 S 0 60 1-410410 - - - - - - 1867981 S 39 79 1-418410 - - - 위결과에서는쓰레드가사용하는점유율은 CP 칼럼으로확인하면된다. procstack SUN의 pstack과동일한결과를확인할수있다. Shell> procstack <process id> ---------- tid# 6901809 (pthread ID: 258) ---------- 0x0900000000062a14 write(??,??,??) + 0x1c8 0x00000001000b9a60 cmnsocksend(cmbblock*,cmnlinkpeer*,int,pdl_time_value*,idvstatindex)() + 0x308 0x00000001000b8d38 0x000000010007f28c 0x000000010007ccc0 0x00000001000cd838 0x00000001000cbb80 0x00000001000cc594 0x0000000100077bd4 0x09000000004a44f4 cmnlinkpeersendtcp(cmnlinkpeer*,cmbblock*)() + 0x30 cmiwriteblock(cmiprotocolcontext*,idbool)() + 0x24c cmiflushprotocol(cmiprotocolcontext*,idbool)() + 0xa8 mmtservicethread::executetask()() + 0xc1c mmtservicethread::multiplexingasshared()() + 0x84 mmtservicethread::run()() + 0x4c4 idtbasethread::staticrunner(void*)() + 0x28 _pthread_body(??) + 0xdc Pstack 의결과를해석하는방법과동일하게쓰레드별로 tid# 을기준으로단락단위로분리하여아래에서위로해석해가도록한다. 위결과에서는어떤질의가수행된이후결과에대한통신쓰레드의송신부분이기록되어있음을확인할수있다. 문제분석을위한 OS 별유틸리티사용가이드 11 page of 18
procfiles SUN 의 pfiles 와동일한결과를보여준다 Shell> pfiles n <process id> 757988 : /home2/lim272/work/altibase_home/bin/altibase -p boot from admin Current rlimit: 100 file descriptors 0: S_IFREG mode:0200 dev:53,1 ino:2731329 uid:222 gid:1 rdev:0,0 O_WRONLY O_APPEND size:451248 name:/home2/lim272/work/altibase_home/trc/altibase_boot.log 1: S_IFREG mode:0222 dev:53,1 ino:2731337 uid:222 gid:1 rdev:0,0 O_WRONLY O_APPEND size:3014040 name:/home2/lim272/work/altibase_home/trc/altibase_sm.log -n 옵션을써야사용하는파일명까지확인할수있다. errpt 운영장비에오류가발생했는지시스템로그를확인하기위해사용한다. 디스크장치의오류나네트웍장치의오류혹은프로세스의비정상적인종료등에대한로그를확인할수있기때문에기술지원시간혹외부에서원인을찾아보아야할경우반드시시스템로그를확인하도록해야한다. Shell> errpt a more --------------------------------------------------------------------------- LABEL: IDENTIFIER: CORE_DUMP C69F5C9B Date/Time: Thu Feb 25 03:59:12 KORST 2010 Sequence Number: 23893 Machine Id: Node Id: Class: Type: Resource Name: 00C76BFD4C00 aix53-p5 S PERM SYSPROC Description SOFTWARE PROGRAM ABNORMALLY TERMINATED Probable Causes SOFTWARE PROGRAM 문제분석을위한 OS 별유틸리티사용가이드 12 page of 18
HP-UX HP CPU 의종류에따라 PA-RISK/ITANIUM 으로분리되는데 PA-RISK 장비에서일부명령어는지원되지않을수있다. glance 를통한 Thread 별 CPU 사용량 HP의경우는 glance라는모니터링툴을통해쓰레드별 CPU사용량을확인할수있다. Shell> glance 를통해실행 <s> 키를누르면특정 process id를입력할수있다. <G> 키를누르면해당프로세스의쓰레드별 CPU 사용량을확인할수있다. pstack SUN 의 pstack 과동일한결과를보여준다. Shell> pstack <process id> -------------------------------- lwpid : 3486042 ------------------------------- 0: c000000000446910 : (unknown) () (unknown) 1: c0000000001a75a0 : (unknown) () (unknown) 2: c0000000000e1130 : (unknown) () (unknown) 3: c0000000000e40c0 : (unknown) () (unknown) 4: 4000000001330fd0 : rpxsender::sleepfornextconnect()() + 0x3b0 (/home/ckh0618/altibase_home/bin/altibase) 5: 4000000001340cc0 : rpxsender::attempthandshake(idbool*)() + 0x4c0 (/home/ckh0618/altibase_home/bin/altibase) 6: 4000000001326f80 : rpxsender::run()() + 0x1a0 (/home/ckh0618/altibase_home/bin/altibase) 7: 4000000001e108a0 : idtbasethread::staticrunner(void*)() + 0x60 (/home/ckh0618/altibase_home/bin/altibase) 8: c0000000000fa220 : (unknown) () (unknown) lwpid 가쓰레드의고유번호를의미한다. 동일하게 lwpid 로단락을구분하고아래에서위로해석한다. 위의경우는이중화 Sender Thread 가상대편과연결하기위한동작을보여주고있다. HP 의경우 pstack 이없다면 gdb 를통해획득할수있다. 다만, 주의할것은 gdb 버전이매우낮은경우쓰레드정보를보려고할경우해당프로세스가비정상종료할수있음으로고객에게사전에위험성을알리고작업하도록한다. Shell> gdb $ALTIBASE_HOME/bin/altibase <process id> (gdb 를실행 ) 문제분석을위한 OS 별유틸리티사용가이드 13 page of 18
(gdb) thread apply all bt (gdb 실행된상태에서수행 ) Thread 339 (system thread 3486042): #0 0xc000000000446910:0 in ksleep+0x30 () from /usr/lib/hpux64/libc.so.1 #1 0xc0000000001a75a0:0 in mxn_sleep+0x1080 () from /usr/lib/hpux64/libpthread.so.1 #2 0xc0000000000e1130:0 in <unknown_procedure> + 0x1210 ()from /usr/lib/hpux64/libpthread.so.1 #3 0xc0000000000e40c0:0 in pthread_cond_timedwait+0x160 ()from /usr/lib/hpux64/libpthread.so.1 #4 0x4000000001330fd0:0 in rpxsender::sleepfornextconnect () at /home/mycomman/work/altidev4/src/rp/rpx/rpxsender.cpp:1333 #5 0x4000000001340cc0:0 in rpxsender::attempthandshake () at /home/mycomman/work/altidev4/src/rp/rpx/rpxsenderhandshake.cpp:89 #6 0x4000000001326f80:0 in rpxsender::run () at /home/mycomman/work/altidev4/src/rp/rpx/rpxsender.cpp:750 #7 0x4000000001e108a0:0 in idtbasethread::staticrunner () at /home/mycomman/work/altidev4/src/id/idt/idtbasethread.cpp:104 #8 0xc0000000000fa220:0 in pthread_bound_body+0x190 () from /usr/lib/hpux64/libpthread.so.1 다른운영체제에서도 gdb/dbx 등의사용은동일하다. pfiles SUN 의 pfiles 와동일한결과를보여준다. Shell> pfiles <process id> 0: S_ISREG mode:666 dev:64,65537 ino:8490324 uid:124 gid:20 size:530024 flags = O_WRONLY O_APPEND O_LARGEFILE file = /home/ckh0618/altibase_home/trc/altibase_boot.log 1: S_ISREG mode:666 dev:64,65537 ino:8490373 uid:124 gid:20 size:8466361 flags = O_WRONLY O_APPEND O_LARGEFILE file = /home/ckh0618/altibase_home/trc/altibase_sm.log 시스템로그 HP 에서시스템로그를확인하기위해다음과같이확인한다. Shell> vi /var/adm/syslog/syslog.log Feb 24 10:32:07 rx5670 vmunix: System Console is on the Built-In Serial Interface 문제분석을위한 OS 별유틸리티사용가이드 14 page of 18
Feb 24 10:32:07 rx5670 vmunix: igelan0: INITIALIZING HP A6794-60001 PCI 1000Base-T at hardware path 0/1/1/0/4/0 Feb 24 10:32:07 rx5670 vmunix: Logical volume 64, 0x3 configured as ROOT Feb 24 10:32:07 rx5670 vmunix: Logical volume 64, 0x2 configured as SWAP Feb 24 10:32:07 rx5670 vmunix: Logical volume 64, 0x2 configured as DUMP 문제분석을위한 OS 별유틸리티사용가이드 15 page of 18
Linux Thread 별 CPU 사용량 리눅스 (Linux) 에서쓰레드별 CPU 를 top 명령어로도확인이가능하다. Top H 옵션으로수행하면쓰레드별로조회가된다. 하지만설치된 procps version 이 3.2.7 이상이어야가능하다. 아닌경우간단하게다음과같이확인한다. ( 역시낮은버전에서는잘지원안됨 ) Shell> ps -LFm p <process id> UID PID PPID LWP C NLWP SZ RSS PSR STIME TTY TIME CMD lim272 6870 1-0 19 204217 355068-19:03? 00:00:01 altibase -p boot from lim272 - - 6870 0 19 - - 7 19:03-00:00:00 - lim272 - - 6871 0 19 - - 0 19:03-00:00:00 - lim272 - - 6872 0 19 - - 6 19:03-00:00:00 - LWP 가쓰레드별고유번호이며 C 항목에출력되는값이 CPU 사용율이다. pstack SUN 과동일한결과를보여준다. 다만, 일부커널이낮은버전의경우는 pstack 이지정된쓰레드의스택만보여주는경우도있다. Shell> pstack <process id> Thread 3 (Thread 1335986528 (LWP 7171)): #0 0x000000331c8bf0a6 in select_nocancel () from /lib64/tls/libc.so.6 #1 0x0000000000a05118 in cmndispatcherselectsock () #2 0x00000000009faa21 in cmiselectdispatcher () #3 0x000000000063ef58 in rpcexecutor::run () #4 0x0000000000a28c31 in idtbasethread::staticrunner () #5 0x000000331d30610a in start_thread () from /lib64/tls/libpthread.so.0 #6 0x000000331c8c6003 in clone () from /lib64/tls/libc.so.6 #7 0x0000000000000000 in?? () Thread 2 (Thread 1315006816 (LWP 7172)): 분석하는방법은다른운영체제의결과보는방법과동일하다. gdb 가설치된경우는 gdb 를이용해 HP 에서설명한바와같이결과를얻어낼수도있다. 문제분석을위한 OS 별유틸리티사용가이드 16 page of 18
사용중인파일목록확인 리눅스에서 lsof 와같은별도의유틸을설치하지않는다면다음과같이한다. Shell> ls l /proc/<process id>/fd lrwx------ lrwx------ lrwx------ lrwx------ lrwx------ lrwx------ 1 lim272 lim272 64 Feb 26 19:34 20 -> /home3/altibase_home/logs/logfile49 1 lim272 lim272 64 Feb 26 19:34 21 -> /home3/altibase_home/logs/logfile50 1 lim272 lim272 64 Feb 26 19:34 22 -> /home3/altibase_home/logs/logfile51 1 lim272 lim272 64 Feb 26 19:34 23 -> /home3/altibase_home/logs/logfile52 1 lim272 lim272 64 Feb 26 19:34 24 -> /home3/altibase_home/logs/logfile53 1 lim272 lim272 64 Feb 26 19:34 25 -> socket:[16080] 리눅스는 /proc/<process id> 경로아래로각종정보를확인할수있음으로관련된사항을참고하도록한다. 시스템로그 /var/log/ 에존재하는파일을확인한다. 일반적으로 messages 파일을확인하도록한다. 문제분석을위한 OS 별유틸리티사용가이드 17 page of 18
알티베이스 서울특별시구로구구로 3 동 182-13 대륭포스트 2 차 1008 호 02-2082-1000 http://www.altibase.com 대전사무소대전광역시서구둔산동 921 주은리더스텔 901 호 042-489-0330 기술지원본부서울특별시구로구구로 3 동 182-13 대륭포스트 2 차 908 호 02-2082-1000 솔루션센터 02-2082-1114 http://support.altibase.com Copyright c 2000~2013 ALTIBASE Corporation. All Rights Reserved. 이문서는정보제공을목적으로제공되며, 사전에예고없이변경될수있습니다. 이문서는오류가있을수있으며, 상업적또는특정목적에부합하는명시적, 묵시적인책임이일체없습니다. 이문서에포함된 ALTIBASE 제품의특징이나기능의개발, 발표등의시기는 ALTIBASE 재량입니다. ALTIBASE는이문서에대하여관련된특허권, 상표권, 저작권또는기타지적재산권을보유할수있습니다. 문제분석을위한 OS 별유틸리티사용가이드 18 page of 18