Linux commands: Difference between revisions
Jump to navigation
Jump to search
→System CPU usage
| Line 302: | Line 302: | ||
* {{kbd | key=''Windows command'' <nowiki>|</nowiki> find ''"string"''}} ({{Win}}) ex: {{kbd | key=<nowiki>netstat -a | find "3306"</nowiki>}} (note: enclose string in double quotation marks)<ref>[http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx?mfr=true Microsoft Windows XP - Find]</ref> | * {{kbd | key=''Windows command'' <nowiki>|</nowiki> find ''"string"''}} ({{Win}}) ex: {{kbd | key=<nowiki>netstat -a | find "3306"</nowiki>}} (note: enclose string in double quotation marks)<ref>[http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx?mfr=true Microsoft Windows XP - Find]</ref> | ||
=== System | === System load average == | ||
==== Using WQL query to obtain Load capacity of each processor ==== | ==== Using WQL query to obtain Load capacity of each processor ==== | ||
on {{Win}}: | on {{Win}}: | ||
| Line 314: | Line 314: | ||
* PHP function [http://php.net/manual/en/function.sys-getloadavg.php sys_getloadavg()] unit: %; '''Need''' to divide by CPU cores number | * PHP function [http://php.net/manual/en/function.sys-getloadavg.php sys_getloadavg()] unit: %; '''Need''' to divide by CPU cores number | ||
==== Using mpstat command ==== | |||
=== System CPU usage === | |||
==== Using mpstat command to obtain CPU usage ==== | |||
Example result of {{kbd | key=<nowiki>mpstat 2 2 | grep -E '^Average'</nowiki>}} on {{Linux}} | Example result of {{kbd | key=<nowiki>mpstat 2 2 | grep -E '^Average'</nowiki>}} on {{Linux}} | ||
<pre> | <pre> | ||
| Line 342: | Line 344: | ||
* There is no CPU steal time in a virtualized environment. | * There is no CPU steal time in a virtualized environment. | ||
==== Using top command ==== | ==== Using top command to obtain CPU usage ==== | ||
# Command: Using top command e.g. {{kbd | key=<nowiki>top</nowiki>}} on {{Linux}} or {{Mac}} | # Command: Using top command e.g. {{kbd | key=<nowiki>top</nowiki>}} on {{Linux}} or {{Mac}} | ||
# Command: Using top command e.g. {{kbd | key=<nowiki>top -l 2 | grep -E '^CPU'</nowiki>}} on {{Mac}} | # Command: Using top command e.g. {{kbd | key=<nowiki>top -l 2 | grep -E '^CPU'</nowiki>}} on {{Mac}} | ||