로그인
Sign in
시스템 부하 측정

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 명령어 사용법

  - /usr에 50,000 characters보다 큰 화일 찾아라.
  
   # find /usr -type f -size +50000c -print

  - core file을 삭제하라.

   # find / -name core -type f -exec rm {} \;

  - /usr/src에서 이름이 mem*.c인것을 찾아라.

   # find /usr/src -type f -name "mem*.c" -print

  - owner가 root이고 set-user-ID를 가지는 모든 화일을 찾아라.

   # find / -perm -04000 -user root -type f -exec ls -l {} \;

  - 최근 이틀내에 쓰여진 화일을 찾아라.

   # find /usr -ctime -2 -print

  - 최근 이틀내에 쓰여지고 크기가 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

  -----------------------------------------------------
  condition                               Conclusion
  -----------------------------------------------------
  0 == r                                  CPU idle
  0 < r / ncpus < 3.0                     No problem
  3.0 <= r / ncpus <= 5                   CPU busy
  5.0 <= r /ncpus                         CPU very busy
  smtx < 200                              No problem
  200 <= smtx < 400                       Mutex stall
  400 <= smtx                             Mutex stall
  -----------------------------------------------------

- psrinfo | grep -c on (CPU 의 개수)

5. Swap space check

# vmstat 30

  -----------------------------------------------------
  Condition                              Conclusion
  -----------------------------------------------------
  100,000K <= swap                       Swap waste
  10,000K <= swap < 100,000K             No problem
  4,000K <= swap < 10,000K               Swap low
  1,000K <= swap < 4,000K                Swap very low
  swap < 1,000K                          No 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

  -----------------------------------------------------
  Condition                                Conclusion
  -----------------------------------------------------
  sr == 0                                  RAM waste
  0 < sr < 200                             No problem
  200 <= sr < 300                          Low RAM
  300 <= sr                                Very 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

  -----------------------------------------------------------
  Condition                                  Conclusion
  -----------------------------------------------------------
  (0  (100*output colls/(output packets)<0.5%)
  &&(other nets OK)
  -----------------------------------------------------------
  (0  (outputpackets)<1.5%)&&(other nets busy)
  -----------------------------------------------------------
  (10<=output packets)&&(0.5%<=100*output    No problem
  colls/output packets <2.0%)
  -----------------------------------------------------------
  (10 <= output packets)&&(2.0%<=100*        Busy network
  output colls/output packets<5.0%)
  -----------------------------------------------------------
  (10<=output packets)&&(5.0%<=100*          Very Busy Net
  output colls/output packets)
  -----------------------------------------------------------
  network type is not ie,le,ne or qe;        Not Ethernet
  it is bf or nf
  -----------------------------------------------------------
  
  * 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에 등록해놓는다.

조회 수 :
695
추천 수 :
12 / 0
등록일 :
2003.12.13
16:47:07 (*.193.52.140)
엮인글 :
http://bestceok.com/xe/index.php?mid=sun_faq&document_srl=2942&act=trackback&key=9dd
게시글 주소 :
http://bestceok.com/xe/index.php?mid=sun_faq&document_srl=2942
List of Articles
번호 제목 글쓴이 날짜 조회 수
71 키보드의 Power 버튼 기능 막기 하록 2003-12-13 452
70 웹서버를 위한 솔라리스 튜닝 하록 2003-12-13 718
69 FTP 자동 다운로드 하록 2003-12-13 567
68 Automount 설정하기 하록 2003-12-13 424
67 Solaris x86 install 하록 2003-12-13 483
66 Login 사용자 수를 늘리려면... 하록 2003-12-13 456
65 Solaris 7 에서 sendmail setup 방법 하록 2003-12-13 556
» 시스템 성능 측정 하록 2003-12-13 695
63 Multiple Monitor 설정 하록 2003-12-13 484
62 Volume Manager에서 rootdg 복구 (2) 하록 2003-12-13 476
61 Volume Manager에서 rootdg 복구 (1) 하록 2003-12-13 802
60 Time zone을 바꾸려면... 하록 2003-12-13 455
59 rsh를 이용해서 다른 시스템으로 디렉토리를 복사하려면.. 하록 2003-12-13 931
58 HDD 추가하는 방법 하록 2003-12-13 483
57 On-board PGX graphic resolution change 하록 2003-12-13 411
56 backup 명령어 정리 (2) 하록 2003-12-13 1253
55 backup 명령어 정리 (1) 하록 2003-12-13 473
54 Disk Quotas 하록 2003-12-13 608
53 Boot Block이 손상되었을 때 하록 2003-12-13 715
52 O/S Backup & Restore 하록 2003-12-13 434