블로그 이미지
redkite

카테고리

분류 전체보기 (291)
00.SI프로젝트 산출물 (0)
00.센터 운영 문서 (0)
01.DBMS ============.. (0)
01.오라클 (117)
01.MS-SQL (15)
01.MySQL (30)
01.PostgreSql (0)
01.DB튜닝 (28)
====================.. (0)
02.SERVER ==========.. (0)
02.서버-공통 (11)
02.서버-Linux (58)
02.서버-Unix (12)
02.서버-Windows (2)
====================.. (0)
03.APPLICATION =====.. (11)
====================.. (0)
04.ETC =============.. (0)
04.보안 (5)
====================.. (0)
05.개인자료 (1)
06.캠핑관련 (0)
07.OA관련 (1)
Total
Today
Yesterday

달력

« » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

공지사항

최근에 올라온 글

prstat나 top으로 메모리 사용량을 볼 수 잇다고 하는데
cpu사용량, process image size와 resident set size정도 볼 수 있던데..
메모리를 어디서 본다는 건지...
아시는 분 있으시면 갈켜주세요..
아, 그리고 process image size와 resident set size가 뭐죠?

 

[답변] 여러가지 경우가 있어서 나누어서 답변을 드리겠습니다.
솔라리스에서 프로세스에 관한 정보를 볼수 있는 여러가지 툴을 제공하고 있습니다.
간단히 정리해 보면
(1) ps
(2) prstat
(3) /usr/dt/bin/dtprocess & (CDE 환경에 있는 것입니다.)

위에 설명한 어떠한 툴을 사용하더라도 비슷한 결과를 보여 줌니다. 현재 저는 CDE환경에서 자주 쓰는 dtprocess를 많이 쓰고 있습니다. 예를 들어 현재 떠있는 프로세스 중 메모리를 가장 많이 쓰고 있는 프로세스를 찾고 싶다면.
# /usr/dt/bin/dtprocess &
툴이 뜨면 툴중에 "RAM"이라고 쓰여진 부분을 클릭하면 RAM 사용량 별로 sort가 됩니다.

그리고 CPU 사용량이 많은 프로세스를 찾고 싶다면 dtprocess를 띄워서 "CPU%" 라는 부분을 클릭하면 CPU 사용량 별로 sort를 해 줍니다.

참고하시라고 썬에서 제공되는 기술문서 중 일부를 공개합니다. 잘 보시면 많은 것을 알 수가 있을 것 같습니다.

[ SUN 기술자료 ]
23. 시스템 부하 측정

1. 용량 확인
1.1 Sun O/S 일 경우
# df
1.2 Solaris일 경우
# df -k
(참고)만약 root filesystem이 90% 이상일 경우 홈페이지에있는 find 명령어 사용법을 참조하여
비정상적으로 생성된 file을 삭제하라. 그리고 root filesystem에 user의 directory가 있는지
살펴 보아라. 특히 backup 시 device 명을 잘못 주어서 file로 저장되어서 시스템이 full 되는
경우가 많음
(참고) Find 명령어 사용법
1. /usr에 50,000 characters보다 큰 화일 찾아라.
# find /usr -type f -size +50000c -print
2. core file을 삭제하라.
# find / -name core -type f -exec rm {} \;
3. /usr/src에서 이름이 mem*.c인것을 찾아라.
# find /usr/src -type f -name "mem*.c" -print
4. owner가 root이고 set-user-ID를 가지는 모든 화일을 찾아라.
# find / -perm -04000 -user root -type f -exec ls -l {} \;
5. 최근 이틀내에 쓰여진 화일을 찾아라.
# find /usr -ctime -2 -print
6. 최근 이틀내에 쓰여지고 크기가 10,000byte이상인 화일이나 디렉토리를 찾아라.
# find /usr -ctime -2 -size +10000c -exec ls -l {} \;



2. CPU 용량 check
2.1 MP Control and Monitoring
* Processor control and information
* psrinfo - 사용가능한 CPU를 보여준다.
# psrinfo
0 on-line since 09/05/97 10:49:27
2 on-line since 09/05/97 10:49:31
* psradm - Enable or disable CPUs
# psradm -f 2 -> 2번 CPU를 off-line
# psrinfo
0 on-line since 09/05/97 11:16:04
2 off-line since 09/05/97 11:18:34
# psradm -n -a -> 모든 process를 on-line
2.2 CPU Rules for the SOlaris 2.x Operating Environment
- vmstat 30 or mpstat 30
conditionConclusion
0 == rCPU idle
0 < r / ncpus < 3.0No problem
3.0 <= r / ncpus <= 5CPU busy
5.0 <= r /ncpusCPU very busy
smtx < 200No problem
200 <= smtx < 400Mutex stall
400 <= smtxMutex stall


- psrinfo | grep -c on (CPU 의 개수)
5. Swap space check
# vmstat 30
ConditionConclusion
100,000K <= swap Swap waste
10,000K <= swap < 100,000KNo problem
4,000K <= swap < 10,000KSwap low
1,000K <= swap < 4,000KSwap very low
swap < 1,000KNo swap

Action to Take
* Swap Low - 실행되는 프로그램 수를 줄이고, swap space를 늘려라.
* No Swap - 프로그램이 멈출 것이다. 즉시 swap space를 늘려라.
(참고) Swap space 를 늘리려면
1. Sun O/S 4.x 일경우
# mkfile 40m /user/swap  (40mb size)
# swapon /user/swap
# pstat -T    (swap size 확인)
# vi /etc/fstab
/usr/swap   swap   swap   rw 0  0
- swap file 삭제
# rm /user/swap
# vi /etc/fstab - add한 entry 를 삭제  
 
2. Solaris 2.x 일 경우
# /usr/sbin/mkfile 40m /user/swapfile 
# swap -a /user/swapfile (O/S에 swap file을 추가함) 
# swap -l 
# vi /etc/vfstab 
/user/swapfile - - swap - no - ( 이라인을 추가)
# swap -s
total : 5828kbytes allocated + 2456k reserved = 8284k used, 103792k
available
( allocated : 현재 사용, reserved : kernel이 잡아놓음 , available : 사용할수 있는양)
# swap -d /user/swapfile (swap add한 file을 삭제)
          . 

6. Memory 용량 check
# vmstat 30
ConditionConclusion
sr == 0RAM waste
0 < sr < 200No problem
200 <= sr < 300Low RAM
300 <= srVery low RAM


* Low RAM - 메모리를 증설해야한다.
7. Disk 부하 check
# iostat -x 30
* svc_t (avque + avwait) : disk 응답시간
* 10 - 50 acceptable
* 100 - 1500 not acceptable
* %b : 디스크를 얼마나 많이 쓰는가?
* 5% 이하는 무시
* 60% 이상이면 조정할 필요가있다.
8. Network 부하 Check
# netstat -i 30
ConditionConclusion
(0<output packets<10)&&(100*output colls/(output
packets)<0.5%)&&(other nets OK)Inactive network
(0<output packets<10)&&(100*output.colls/(output
packets)<1.5%)&&(other nets busy)Unbalanced
(10<=output packets)&&(0.5%<=100*output colls/output packets
<2.0%)No problem
(10 <= output packets)&&(2.0%<=100*output colls/output
packets<5.0%)Busy network
(10<=output packets)&&(5.0%<=100*output colls/output packets)Very
Busy Net
network type is not ie,le,ne or qe;it is bf or nfNot Ethernet


* Busy Network - 네트웍에 너무나 많은 충돌이 생겨서 사용자들이 응답을 기다리는 늘어나 고 throughput이
감소한다. 만약 다른 네트웍이 있다면 부하를 주는 것을 부하가없는 네트웍 으로 옮겨라. 또는 ATM 이나 100-MB
Ethernet, FDDI같은 빠른 네트웍으로 upgrade하라.
9. System error messages check
# vi /var/adm/messages
# cd /var/adm
# grep panic *
# grep error *
# grep warning *
10. system 정보 출력
# /usr/platform/'uname -i'/sbin/prtdiag (this show usefull hardware
information and failures of system)
# /etc/prtvtoc (show the detail information of disk slice ex) prtvtoc
/dev/dsk/c0t0d0s2)
# /usr/sbin/eeprom (user can set some of variables of NVRAM via this
command ex) eeprom boot-device=disk3)
# /usr/sbin/prtconf -vp ( Shows device configuration )
# devinfo -vp (Shows device configuration for Solaris 1.x)
# /usr/sbin/sysdef ( Shows software configuration )
# /usr/bin/dmesg | more ( collect system diagnostic messages to form error
log
# /usr/proc/bin/ptree (Process trees that contain the process)
# /usr/proc/bin/pwdx pid ( Current working directory for a process)
# /usr/proc/bin/pldd pid ( Dynamic libraries linked into a process)
# /usr/proc/bin/pmap pid ( Address space map)

11. Performance gathering script
date >> /sunsolv/hangdata/vmstat.out
vmstat 30 10 >> /sunsolv/hangdata/vmstat.out
date >> /sunsolv/hangdata/iostat.out
iostat -xtc 30 10 >> /sunsolv/hangdata/iostat.out
date >> /sunsolv/hangdata/ps.out
/usr/ucb/ps -aux >> /sunsolv/hangdata/ps.out
date >> /sunsolv/hangdata/kmstat.out
echo kmastat | crash >> /sunsolv/hangdata/kmstat.out
date >> /sunsolv/hangdata/kernelmap.out
echo "map kernelmap" | crash >> /sunsolv/hangdata/kernelmap.out
위 명령어를 매 15분 마다 실행 하도록 crontab에 등록해놓는다.

Posted by redkite
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함