03-11-2008
Looks like virtually every command will tell you how many CPUs the box has. ;-))
Well, here is one more possibility: "vmstat 1" will, before the normal vmstat-output, print a line with "cpu=<nr>" and "lcpu=<nr>". The number after "cpu=" is the number of physical CPUs, the number after "lcpu=" is the number of logical CPUs.
bakunin
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Can someone tell me which command I should use to get the detail CPU info in one HP unix box, asuch as # of CPU, CPU Speed and CPU HW Support
Thanks (2 Replies)
Discussion started by: abcde
2 Replies
2. Shell Programming and Scripting
Can anybody please help me on how to optimize following command as it use up a lot of CPU :
tail -f $DIR3$DATE4.log |\
while read line
do echo $line | egrep "Processing incoming SMS message" | sed 's/\,/ /g' \
| awk '{print $2}' >> $DIR2/LIST1.$DATE4.log && echo... (6 Replies)
Discussion started by: azmanw2004
6 Replies
3. HP-UX
I want to record one application's(like oracle etc...) CPU usage summary.
I can filter by "ps". But how to sum?
Thanks (1 Reply)
Discussion started by: jiarong.lu
1 Replies
4. Shell Programming and Scripting
Dear all,
Is there any generic command working on all Unix listing the CPU of a server?
I found different command line per OS but I am looking for a more generic one.
Thanks for your answer. (5 Replies)
Discussion started by: sgoiffon
5 Replies
5. UNIX for Dummies Questions & Answers
Can some body tune the below command, its occupyinh more than 90% of CPU some times.
tail -n 1000 /logs/trace.log | awk 'BEGIN{OOM = 0; ScE = 0; NaE = 0; Jms = 0}
/OutOfMemoryException/{OOM = 1}
/StaleConnectionException/{ScE = 1}
/NamingException/{NaE = 1}
/JmsTimeOutException/{Jms = 1}... (17 Replies)
Discussion started by: senthil.ak
17 Replies
6. Shell Programming and Scripting
Hi all,
I found like top command could be used to find the Memory and CPU utilization. But i want to know how to find the Memory and CPU utilization for a particular user using top command.
Thanks in advance.
Thanks,
Ananthi.U (2 Replies)
Discussion started by: ananthi_ku
2 Replies
7. Shell Programming and Scripting
Hi,
I need write a script that check how much CPU% a particular process is using so I execute something like :
while :
do
ps aux | awk '{ if($3 < 10) {printf( "this process %s CPU: %f and process %d\n",$1,$3,$2)}}'
sleep 300
done
but issue here is that I compare... (0 Replies)
Discussion started by: arizah
0 Replies
8. Shell Programming and Scripting
I receive on a daily basis CPU measures on a UNIX Server (AIX 5.3 version, korn shell). These CPU measures are provided by Omnivision tool.
We could see that Omnivision daily stats are not always equal to NMON stats regarding CPU level.
On my side (I work in an IT Production Support Team, not... (0 Replies)
Discussion started by: Scofield38
0 Replies
9. HP-UX
Hi,
I see following 'nfsd' command is using more CPU. Could someone please comment on it's pros and cons of it?
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
5 ? 16890 root 152 20 34696K 12036K run 57166:48 856.13 854.64 nfsd
OS -- HP-UX
One... (4 Replies)
Discussion started by: Maddy123
4 Replies
10. Linux
Hi All,
Am very new to Linux and unix ...need below help .
need to list of process consuming more than 40% cpu and which are older than 10 days of a particular user ....
Thanks
V (4 Replies)
Discussion started by: venky456
4 Replies
CHCPU(8) System Administration CHCPU(8)
NAME
chcpu - configure CPUs
SYNOPSIS
chcpu -c|-d|-e|-g cpu-list
chcpu -p mode
chcpu -r|-h|-V
DESCRIPTION
chcpu can modify the state of CPUs. It can enable or disable CPUs, scan for new CPUs, change the CPU dispatching mode of the underlying
hypervisor, and request CPUs from the hypervisor (configure) or return CPUs to the hypervisor (deconfigure).
Some options have a cpu-list argument. Use this argument to specify a comma-separated list of CPUs. The list can contain individual CPU
addresses or ranges of addresses. For example, 0,5,7,9-11 makes the command applicable to the CPUs with the addresses 0, 5, 7, 9, 10, and
11.
OPTIONS
-c, --configure cpu-list
Configure the specified CPUs. Configuring a CPU means that the hypervisor takes a CPU from the CPU pool and assigns it to the vir-
tual hardware on which your kernel runs.
-d, --disable cpu-list
Disable the specified CPUs. Disabling a CPU means that the kernel sets it offline.
-e, --enable cpu-list
Enable the specified CPUs. Enabling a CPU means that the kernel sets it online. A CPU must be configured, see -c, before it can be
enabled.
-g, --deconfigure cpu-list
Deconfigure the specified CPUs. Deconfiguring a CPU means that the hypervisor removes the CPU from the virtual hardware on which
the Linux instance runs and returns it to the CPU pool. A CPU must be offline, see -d, before it can be deconfigured.
-p, --dispatch mode
Set the CPU dispatching mode (polarization). This option has an effect only if your hardware architecture and hypervisor support
CPU polarization. Available modes are:
horizontal The workload is spread across all available CPUs.
vertical The workload is concentrated on few CPUs.
-r, --rescan
Trigger a rescan of CPUs. After a rescan, the Linux kernel recognizes the new CPUs. Use this option on systems that do not auto-
matically detect newly attached CPUs.
-V, --version
Display version information and exit.
-h, --help
Display help text and exit.
RETURN CODES
chcpu has the following return codes:
0 success
1 failure
64 partial success
AUTHOR
Heiko Carstens <heiko.carstens@de.ibm.com>
COPYRIGHT
Copyright IBM Corp. 2011
SEE ALSO
lscpu(1)
AVAILABILITY
The chcpu command is part of the util-linux package and is available from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils
/util-linux/>.
util-linux July 2014 CHCPU(8)