[TUTORIAL] ps_mem.py - Check RAM usage per program

Discussion in 'VPS (Virtual Private Server)' started by arieonline, 20 Dec 2012.

Thread Status:
Not open for further replies.
  1. arieonline

    arieonline Expert 1.0

    Messages:
    886
    Likes Received:
    127
    Trophy Points:
    43
    Pendahuluan
    Terkadang kita ingin mengetahui penggunaan RAM sesuatu program. Nah silahkan gunakan script berikut. Sangat berguna untuk hunting program yg menggunakan RAM paling gede.

    source
    Code:
    https://raw.github.com/pixelb/scripts/master/scripts/ps_mem.py
    cara menjalankannya
    1. downlod
    wget https://raw.github.com/pixelb/scripts/master/scripts/ps_mem.py

    2. kasih ijin eksekusi
    chmod +x ps_mem.py

    3. jalankan
    ./ps_mem.py

    4. contoh hasil output
    Code:
    root@vps4:~# ./ps_mem.py 
     Private  +   Shared  =  RAM used	Program 
    
     48.0 KiB +  37.5 KiB =  85.5 KiB	init
      8.0 KiB + 104.0 KiB = 112.0 KiB	saslauthd (2)
     96.0 KiB +  27.5 KiB = 123.5 KiB	vnstatd
     76.0 KiB +  48.0 KiB = 124.0 KiB	logger
    116.0 KiB +  33.5 KiB = 149.5 KiB	syslogd
    116.0 KiB +  58.0 KiB = 174.0 KiB	cron
    156.0 KiB +  41.0 KiB = 197.0 KiB	xinetd
    448.0 KiB +  72.5 KiB = 520.5 KiB	sendmail-mta
    392.0 KiB + 273.5 KiB = 665.5 KiB	openvpn (2)
    328.0 KiB + 340.0 KiB = 668.0 KiB	mysqld_safe
    532.0 KiB + 201.5 KiB = 733.5 KiB	ntpd
    600.0 KiB + 345.0 KiB = 945.0 KiB	bash
      1.8 MiB +  91.0 KiB =   1.9 MiB	snmpd
      1.8 MiB + 470.5 KiB =   2.3 MiB	sshd (2)
      2.5 MiB + 390.5 KiB =   2.9 MiB	fail2ban-server
      1.9 MiB +   1.5 MiB =   3.4 MiB	nginx (5)
     12.1 MiB +  71.0 KiB =  12.1 MiB	miniserv.pl
     28.2 MiB +   3.9 MiB =  32.1 MiB	php5-fpm (3)
     58.8 MiB + 140.0 KiB =  58.9 MiB	mysqld
    ---------------------------------
                            118.0 MiB
    =================================
    bandingkan dgn hasil free -m
    Code:
    root@vps4:~# free -m
                 total       used       free     shared    buffers     cached
    Mem:          1024        287        736          0          0        163
    -/+ buffers/cache:        123        900
    Swap:            0          0          0
    Mudah2an bermanfaat

    nb:
    saya tidak membuat script ini
     
    galuh82, deRegen, xphones and 4 others like this.
  2. sigmabisnis

    sigmabisnis Hosting Guru Web Hosting (Company)

    Messages:
    2,182
    Likes Received:
    144
    Trophy Points:
    63
    Hasil perbandingannya lumayan jauh berbeda juga ya mas?
    Used 287Mb dengan 118Mb (plus rincian detail program nya)
     
  3. arieonline

    arieonline Expert 1.0

    Messages:
    886
    Likes Received:
    127
    Trophy Points:
    43
    anu, yg dibandingkan 118MB dgn 123MB
     
  4. GriyaHosting

    GriyaHosting Expert 1.0

    Messages:
    966
    Likes Received:
    76
    Trophy Points:
    28

    yang dipake buffer nya pak,
     
  5. sigmabisnis

    sigmabisnis Hosting Guru Web Hosting (Company)

    Messages:
    2,182
    Likes Received:
    144
    Trophy Points:
    63
    Ooh iya itu, selisih nya sekitar 5 Mb-an jadinya yaa.... :)
     
  6. hostnic.id

    hostnic.id Hosting Guru Web Hosting (Company)

    Messages:
    1,099
    Likes Received:
    30
    Trophy Points:
    48
    ijin copas boleh ya :)
     
  7. idcolo

    idcolo Apprentice 1.0 Web Hosting (Company)

    Messages:
    336
    Likes Received:
    29
    Trophy Points:
    28
    trit yang sangat berguna sekali
     
  8. xphones

    xphones Expert 1.0

    Messages:
    747
    Likes Received:
    41
    Trophy Points:
    28
    Mantep.... bisa membantu mengecak ram usage service ... thanks button has been pencet :)
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...