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 je bogat nabor ukazov za pridobivanje sistem info. 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. Eden od delov koristne informacije, ki bi skrbnika sistema, je treba vedeti, kaj celotne obremenitve sistema na strežnik.
There are a couple of ways to get this information, which may or may not be enabled on your system. Obstaja nekaj načinov, kako priti do teh informacij, ki lahko ali ne sme biti omogočen na vaš sistem. 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. To je koristno poznati več kot en način, da dobite uptime informacije v primeru, ukazi so invalidi na vašem skupnih gostiteljski strežnik.
uptime uptime
The uptime command gives information on system load averages for the past 1, 5, and 15 minutes: Ukaz uptime daje informacije o povprečnih obremenitev sistema za zadnjih 1, 5 in 15 minut:
Example: Primer:
[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 up 87 days, 13:13, 1 uporabnik, 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 ukaza kaže, ki je prijavljen in kaj delajo, vključno s sistemom za tovor povprečja zadnjih 1, 5 in 15 minut.
[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 up 87 days, 13:13, 1 uporabnik, load average: 0,00, 0,00, 0,39
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT USER TTY FROM LOGIN @ IDLE JCPU PCPU KAJ
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 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 datoteka vsebuje informacije o sistemu obremenitev. Most likely the uptime/w commands utilize this information. Najverjetneje uptime / w ukazi uporabiti te informacije. The first 3 values contain system load averages for the past 1, 5, and 15 minutes. Prvi 3 vrednosti vsebuje povprečja obremenitev sistema za zadnjih 1, 5 in 15 minut.
[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. Obstajajo verjetno nekaj več ukazov, vendar so to tisti off vrhu moje glave, da bi vedel.

Daily Email Updates Dnevni Email Updates
You can get our how-to articles in your inbox each day for free. Lahko dobite našo kako do člankov v vašo mapo »Prejeto vsak dan brezplačno. Just enter your name and email below: Preprosto vpišite vaše ime in e-pošto spodaj:



there's also the top command obstaja tudi ukaz vrh
Hi, Živjo,
do you know how to get the load on each processor on a server. veš kako priti obremenitev za vsak procesor v strežniku. Not the global load but the specific one ? Ne globalno obremenitev, vendar specifično?
thx for the answer thx za odgovor
I know top can give you the usage for each core. Vem, da vam lahko top navada za vsako jedro. I'm not sure if it does it out of the box, or if there's any special configuration required. Nisem prepričan, če ne iz škatle, ali če obstaja posebna potrebno konfiguracijo.
1787 processes: 1782 sleeping, 2 running, 3 zombie, 0 stopped 1787 procesi: 1.782 s spanjem, teče 2, 3 zombie, 0 ustavili
CPU0 states: 7.0% user 5.1% system 0.0% nice 0.0% iowait 87.0% idle CPU0 določa: 7,0% uporabnikov sistema 5,1% 0,0% 0,0% lepo iowait 87,0% idle
CPU1 states: 18.1% user 1.0% system 0.0% nice 0.0% iowait 80.0% idle CPU1 določa: 18,1% uporabnikov sistema 1,0% 0,0% 0,0% lepo iowait 80,0% idle
CPU2 states: 33.1% user 0.1% system 0.0% nice 0.0% iowait 65.0% idle CPU2 določa: 33,1% uporabnikov sistema 0,1% 0,0% 0,0% lepo iowait 65,0% idle
CPU3 states: 40.0% user 2.0% system 0.0% nice 0.0% iowait 57.0% idle CPU3 določa: 40,0% uporabnikov sistema 2,0% 0,0% 0,0% lepo iowait 57,0% idle
CPU4 states: 7.1% user 0.1% system 0.0% nice 3.0% iowait 88.0% idle CPU4 določa: 7,1% uporabnikov sistema 0,1% 0,0% 3,0% lepo iowait 88,0% idle
CPU5 states: 7.1% user 29.0% system 0.0% nice 0.0% iowait 62.1% idle CPU5 določa: 7,1% 29,0% uporabnikov sistema 0,0% 0,0% lepo iowait 62,1% idle
CPU6 states: 25.1% user 1.0% system 0.0% nice 0.0% iowait 72.1% idle CPU6 določa: 25,1% uporabnikov sistema 1,0% 0,0% 0,0% lepo iowait 72,1% idle
CPU7 states: 16.0% user 0.1% system 0.0% nice 0.0% iowait 83.0% idle CPU7 določa: 16,0% uporabnikov sistema 0,1% 0,0% 0,0% lepo iowait 83,0% idle
For example this would be shown right at the top for a multi-core system. Na primer to bi bilo prikazano na vrhu desno za multi-jedro sistema.
You can use the grep command to monitor the CPU load average: Lahko uporabite ukaz grep za spremljanje in nadzor povprečnih obremenitev CPU:
top -b | grep -2 “load average” top-b | grep -2 "povprečna obremenitev"
I'ma little curious how to get the load of a single core from the /proc file system? Sem malo radoveden, kako priti obremenitev posamezen jedro iz / proc datotečnega sistema?