Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Get CPU / System Load Average on Ubuntu Linux Get CPU / System Load Average na Ubuntu Linux

Ubuntu linux has a rich set of commands for getting system info. Ubuntu Linux má bohatú sadu príkazov pre systém získavania informácií. One of the useful pieces of information that a system administrator might need is to know what the overall system load on a server is. Jedným z užitočných informácií, ktoré správca systému, je potrebné vedieť, čo je zaťaženie systému na serveri.

There are a couple of ways to get this information, which may or may not be enabled on your system. Existuje niekoľko spôsobov, ako získať tieto informácie, ktoré môžu alebo nemusia byť povolené vo vašom systéme. It's useful to know more than one way to get the uptime information in case the commands are disabled on your shared hosting server. Je užitočné vedieť, viac ako jeden spôsob, ako získať informácie, uptime v prípade, že príkazy sú vypnuté na vašom serveri zdieľaného hostingu.

uptime uptime

The uptime command gives information on system load averages for the past 1, 5, and 15 minutes: Príkaz uptime poskytuje informácie o priemerné zaťaženie systému za posledných 1, 5 a 15 minút:

Example: Príklad:

[root@ubuntu geek]# uptime [root @ ubuntu geek] # uptime
05:59:07 up 87 days, 13:13, 1 user, load average: 0.00, 0.00, 0.39 05:59:07 až 87 dní, 13:13, 1 user, load average: 0.00, 0.00, 0.39

w w

The w command shows who is logged on and what they are doing, including system load averages for the past 1, 5, and 15 minutes. W príkaz ukazuje, kto je prihlásený a čo robia, vrátane priemerné zaťaženie systému za posledných 1, 5 a 15 minút.

[root@ubuntu geek]# uptime [root @ ubuntu geek] # uptime
05:59:56 up 87 days, 13:13, 1 user, load average: 0.00, 0.00, 0.39 05:59:56 až 87 dní, 13:13, 1 user, load average: 0.00, 0.00, 0.39
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT OD UŽIVATELE TTY LOGIN @ IDLE JCPU PCPU CO
geek pts/0 192.168.1.115 6:31pm 0.00s 0.62s 0.03s /usr/sbin/sshd geek pts / 0 192.168.1.115 6:31 pm 0.00s 0.62s 0.03s / usr / sbin / sshd

/proc/loadavg / Proc / loadavg

The /proc/loadavg file contains information on the system load. / Proc / loadavg súbor obsahuje informácie o zaťažení systému. Most likely the uptime/w commands utilize this information. S najväčšou pravdepodobnosťou uptime / w príkazy využiť tejto informácie. The first 3 values contain system load averages for the past 1, 5, and 15 minutes. Prvé 3 hodnoty obsahujú priemery záťaž systému za posledných 1, 5 a 15 minút.

[root@ubuntu geek]# cat /proc/loadavg [root @ ubuntu geek] # cat / proc / loadavg
0.00 0.00 0.39 1/49 15352 0,00 0,00 0,39 1 / 49 15352

There are probably some more commands, but these are the ones off the top of my head that I know of. Existuje snáď nejaké ďalšie príkazy, ale to sú tie, z vrcholu mojej hlavy, že neviem.

This article was originally written on 11/28/06 Tagged with: Tento článok bol pôvodne napísaný na 11/28/06 Tagged s: Ubuntu Ubuntu , , Ubuntu Tips & Tweaks Ubuntu Tipy & Tweak

Daily Email Updates Denný Svářeč

You can get our how-to articles in your inbox each day for free. Môžete si naše jak-na články vo vašej schránky každý deň zadarmo. Just enter your name and email below: Stačí zadať svoje meno a e-mail nižšie:


Name: Meno:
Email: E-mail:

Comments (5) Komentáre (5)

  1. netking netking

    there's also the top command K dispozícii je tiež najvyššie velenie ;-)

  2. oliver oliver

    Hi, Nazdar,
    do you know how to get the load on each processor on a server. viete, ako sa dostať zaťaženie na každý procesor na serveri. Not the global load but the specific one ? Nie globálne zaťaženie, ale jeden konkrétny?
    thx for the answer thx za odpoveď

  3. Steve Steve

    I know top can give you the usage for each core. Viem, že začiatok vám dať za využitie každé jadro. I'm not sure if it does it out of the box, or if there's any special configuration required. Nie som si istý, či je to z krabice, alebo či je vyžadované žiadne špeciálne nastavenia.

    1787 processes: 1782 sleeping, 2 running, 3 zombie, 0 stopped 1787 procesy: 1782 spanie, 2. beh, 3. zombie, 0 stopped
    CPU0 states: 7.0% user 5.1% system 0.0% nice 0.0% iowait 87.0% idle CPU0 uvádza: 7.0% user 5.1% system 0.0% nice 0.0% iowait 87.0% idle
    CPU1 states: 18.1% user 1.0% system 0.0% nice 0.0% iowait 80.0% idle CPU1 uvádza: 18.1% user 1.0% system 0.0% nice 0.0% iowait 80.0% idle
    CPU2 states: 33.1% user 0.1% system 0.0% nice 0.0% iowait 65.0% idle CPU2 uvádza: 33.1% user 0.1% system 0.0% nice 0.0% iowait 65.0% idle
    CPU3 states: 40.0% user 2.0% system 0.0% nice 0.0% iowait 57.0% idle CPU3 uvádza: 40.0% user 2.0% system 0.0% nice 0.0% iowait 57.0% idle
    CPU4 states: 7.1% user 0.1% system 0.0% nice 3.0% iowait 88.0% idle CPU4 uvádza: 7.1% user 0.1% system 0.0% nice 3.0% iowait 88,0% idle
    CPU5 states: 7.1% user 29.0% system 0.0% nice 0.0% iowait 62.1% idle CPU5 uvádza: 7,1% používateľov systému 29,0% 0,0% 0,0% nice iowait 62,1% idle
    CPU6 states: 25.1% user 1.0% system 0.0% nice 0.0% iowait 72.1% idle CPU6 uvádza: 25.1% user 1.0% system 0.0% nice 0.0% iowait 72.1% idle
    CPU7 states: 16.0% user 0.1% system 0.0% nice 0.0% iowait 83.0% idle CPU7 uvádza: 16.0% user 0.1% system 0.0% nice 0.0% iowait 83.0% idle

    For example this would be shown right at the top for a multi-core system. Napríklad by to byť uvedené priamo v hornej časti pre multi-core systému.

  4. Bob Bob

    You can use the grep command to monitor the CPU load average: Môžete použiť príkaz grep pre monitorovanie zaťaženia CPU priemerne:

    top -b | grep -2 “load average” top-b | grep -2 "load average"

  5. brainextender brainextender

    I'ma little curious how to get the load of a single core from the /proc file system? Som trochu zvedavý, ako sa dostať zaťaženie jedného jadra od súborového systému / proc?


Our Friends Naši priatelia
Getting Started Začíname


About How-To Geek O tom, ako-To Geek
What Is That Process? Čo je to za proces?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe Dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe WMPNSCFG.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.