Get CPU / System Load Average on Ubuntu Linux Get CPU / System Vidējāslodze par Ubuntu Linux
Ubuntu linux has a rich set of commands for getting system info. Ubuntu Linux ir iespaidīgu komandu, lai iegūtu sistēmas 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. Viens no noderīga gabalus informāciju, ka sistēmas administrators var būt nepieciešams ir zināt vispārējās sistēmas slodzi uz servera ir.
There are a couple of ways to get this information, which may or may not be enabled on your system. Ir veidi kā iegūt šo informāciju, kas var būt vai var nebūt iespējots jūsu sistēmā pāris. 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. Tas ir noderīgi zināt vairāk nekā viens veids, kā iegūt uptime informāciju, ja komandas ir atslēgtas jūsu hostinga serverī.
uptime Uptime
The uptime command gives information on system load averages for the past 1, 5, and 15 minutes: Uptime komandu sniedz informāciju par sistēmas slodze vidējās vērtības iepriekšējo 1, 5 un 15 minūtes:
Example: Piemērs:
[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 līdz 87 dienām, 13:13, 1 user, slodzes 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 komanda parāda, kurš ir pieteicies un, ko viņi dara, ieskaitot sistēmas slodze vidējās vērtības iepriekšējo 1, 5 un 15 minūtes.
[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 līdz 87 dienām, 13:13, 1 user, slodzes average: 0.00, 0.00, 0,39
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT LIETOTĀJU TTY NO LOGIN @ IDLE JCPU PCPU KAS
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 fails satur informāciju par sistēmas slodzi. Most likely the uptime/w commands utilize this information. Visticamāk uptime / w komandas izmantot šo informāciju. The first 3 values contain system load averages for the past 1, 5, and 15 minutes. Pirmās 3 vērtības ir sistēmas slodze vidējās vērtības iepriekšējo 1, 5 un 15 minūtes.
[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. Ir iespējams dažas vairāk komandu, bet tie ir pie augšas manas galvas tiem, ko es zinu.

Daily Email Updates Daily Email Updates
You can get our how-to articles in your inbox each day for free. Jūs varat saņemt mūsu how-to rakstus savā pastkastītē katru dienu par brīvu. Just enter your name and email below: Vienkārši ievadiet jūsu vārdu un e-pasta zemāk:



there's also the top command tur ir arī top komanda
Hi, Čau,
do you know how to get the load on each processor on a server. Vai jūs zināt, kā iegūt slodzei uz katras procesora uz servera. Not the global load but the specific one ? Ne globālā slodzi, bet specifiskā?
thx for the answer thx par atbildi
I know top can give you the usage for each core. Es zinu Top Vai jums izmantošana, lai katrs kodols. I'm not sure if it does it out of the box, or if there's any special configuration required. Es neesmu pārliecināts, vai tas tiek darīts no ailē, vai, ja tur ir kādas īpašas konfigurācijas nepieciešams.
1787 processes: 1782 sleeping, 2 running, 3 zombie, 0 stopped 1.787 procesiem: 1782 traucējumi, 2 darbības, 3 zombie, 0 pārtraukta
CPU0 states: 7.0% user 5.1% system 0.0% nice 0.0% iowait 87.0% idle CPU0 nosaka: 7.0% lietotāju 5,1% sistēma 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 norāda: 18.1% lietotāju 1,0% sistēma 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 norāda: 33.1% lietotāju 0,1% sistēma 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 nosaka: 40.0% lietotāju 2,0% sistēma 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 nosaka: 7.1% lietotāju 0,1% sistēma 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 nosaka: 7.1% lietotāju 29,0% sistēmas 0.0% nice 0,0% iowait 62.1% idle
CPU6 states: 25.1% user 1.0% system 0.0% nice 0.0% iowait 72.1% idle CPU6 nosaka: 25.1% lietotāju 1,0% sistēma 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 norāda: 16.0% lietotāju 0,1% sistēma 0.0% nice 0,0% iowait 83,0% idle
For example this would be shown right at the top for a multi-core system. Piemēram, tas būtu redzams pa labi augšu uz multi-core sistēmu.
You can use the grep command to monitor the CPU load average: Jūs varat izmantot grep komandu, lai pārraudzītu CPU slodze vidēji:
top -b | grep -2 “load average” top-b | grep -2 "kravas vidējais rādītājs"
I'ma little curious how to get the load of a single core from the /proc file system? Esmu nedaudz ziņkārīgs, kā nokļūt slodze Viendzīslas no / proc failu sistēmu?