Sponsored Content
Top Forums Shell Programming and Scripting list which process using how many cpu Post 302441762 by achenle on Monday 2nd of August 2010 09:01:43 AM
Old 08-02-2010
You can use mpstat or prstat to see how busy your system and CPU(s) are.

Why do you care what process is running on which CPU? That can and does change very rapidly, maybe hundreds or thousands of times a second. Simply running whatever utility you use to observe that will change the result.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

process -> 1 cpu

Is there a way I can assign processes to different processors? I know in windows xp you can set process affinity, and wondered if there is a *nix equivelant. (2 Replies)
Discussion started by: Solitare
2 Replies

2. UNIX for Dummies Questions & Answers

process not using enough cpu

I am running solaris 9 on a SUn 480r. It is running SAS statistical software, these processes in full flow normally run at about 50-60% cpu (theres nothing else really running on the box) this is fine, and the SAS jobs get run nice and quick. However over the last few weeks everytime a SAS job is... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

3. Solaris

How to find which process is using up too much CPU

Hi, I need to find which processes are hogging the cpu up. please advise. Thanks (1 Reply)
Discussion started by: 0ktalmagik
1 Replies

4. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

5. Shell Programming and Scripting

CPU Usage for a particular process

Hi, I have a shell script. But, upon execution of the same, the cpu usage is sometimes getting 100 % (checked executing top command). At that point of time, my process hangs, doesn't run anymore. I need to kill it manually. My concern is, is there any default method, by which I can check... (1 Reply)
Discussion started by: jitendriya.dash
1 Replies

6. Red Hat

Process by CPU

Hello All, I am preparing a script to capture the processes consuming more CPU. So is there any way that i can sort & redirect to file only those processes consuming more than 5.0 % using ps command itself. Regards Ankit (3 Replies)
Discussion started by: ajaincv
3 Replies

7. Shell Programming and Scripting

CPU Usage of a process

Hi guys, I am currently writing a JAVA script to monitor certain unix processes through JConsole. Upon having lots of trouble with runtime.exec, i decided to bypass the top/ps command call and just get the information straight from /proc/*pid*/whatever. Now i can pull back any... (0 Replies)
Discussion started by: matt9949
0 Replies

8. Solaris

process CPU time

We are using JAVA program and strange thing is it takes 100% CPU when not in use. The program function is to stream a file on output port (one direction). It checks one directory and when there is a file in it, starts. While it is streaming the CPU usage is normal, about 20%. But, if... (9 Replies)
Discussion started by: orange47
9 Replies

9. Emergency UNIX and Linux Support

CPU and memory utilization of a process, by process name

Can someone please help me with a script that will help in identifying the CPU & memory usage by a process name, rather than a process id.This is to primarily analyze the consumption of resources, for performance tweaking. G (4 Replies)
Discussion started by: ggayathri
4 Replies

10. Shell Programming and Scripting

If a process cpu % is higer than

Is this possible as part of a bigger script to do? eg: elif myprocess.bin cpu% > 12 exit 1 elif is there a command for this? thanks (9 Replies)
Discussion started by: bilboNIX
9 Replies
mpstat(1M)						  System Administration Commands						mpstat(1M)

NAME
mpstat - report per-processor or per-processor-set statistics SYNOPSIS
/usr/bin/mpstat [-aq] [-p | -P set] [interval [count]] DESCRIPTION
The mpstat command reports processor statistics in tabular form. Each row of the table represents the activity of one processor. The first table summarizes all activity since boot. Each subsequent table summarizes activity for the preceding interval. All values are rates listed as events per second unless otherwise noted. During execution of the kernel status command, the state of the kernel can change. If relevant, a state change message is included in the mpstat output, in one of the following forms: <<processor 3 moved from pset: -1 to: 1>> <<pset destroyed: 1>> <<pset created: 1>> <<processors added: 1, 3>> <<processors removed: 1, 3>> The mpstat command reports the following information: CPU or SET Without the -a option, mpstat reports CPU statistics for a processor ID. With the -a option, mpstat reports SET statistics for a processor set ID. minf minor faults mjf major faults xcal inter-processor cross-calls intr interrupts ithr interrupts as threads (not counting clock interrupt) csw context switches icsw involuntary context switches migr thread migrations (to another processor) smtx spins on mutexes (lock not acquired on first try) srw spins on readers/writer locks (lock not acquired on first try) syscl system calls usr percent user time sys percent system time wt the I/O wait time is no longer calculated as a percentage of CPU time, and this statistic will always return zero. idl percent idle time sze number of processors in the requested processor set set processor set membership of each CPU OPTIONS
The following options are supported: -a Aggregate output by processor set. Sort the output by set. The default output is sorted by CPU number. -p Report processor set membership of each CPU. Sort the output by set. The default output is sorted by CPU number. -P set Display only those processors in the specified set. -q Suppress messages related to state changes. interval Report once each interval seconds. count Only print count reports. EXAMPLES
Example 1 Using mpstat to Generate User and System Operation Statistics The following command generates processor statistics over a five-second interval in two reports. The command shows the processor set mem- bership of each CPU. The default output is sorted by CPU number, aggregated by processor set, for user (usr) and system (sys) operations. example% mpstat -ap 5 2 SET minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl sze 0 6 0 355 291 190 22 0 0 0 0 43 0 2 0 43 1 1 24 17 534 207 200 70 1 0 2 0 600 4 1 0 84 2 2 19 7 353 325 318 44 0 0 5 0 345 1 1 0 94 3 3 36 2 149 237 236 14 0 0 4 0 97 0 0 0 98 2 SET minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl sze 0 1 0 720 405 304 55 0 0 18 0 12 0 15 0 81 1 1 0 69 1955 230 200 313 33 4 41 9 7086 34 10 0 19 2 2 0 46 685 314 300 203 11 0 54 1 5287 36 6 0 28 3 3 0 0 14 386 384 0 0 0 0 0 0 0 0 0 100 2 ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |See below. | +-----------------------------+-----------------------------+ Invocation is evolving. Human readable output is unstable. SEE ALSO
sar(1), iostat(1M), sar(1M), vmstat(1M), attributes(5) NOTES
The sum of CPU utilization might vary slightly from 100 due to rounding errors in the production of a percentage figure. The total time used for CPU processing is the sum of usr and sys output values, reported for user and system operations. The idl value reports the time that the CPU is idle for any reason other than pending disk I/O operations. Run the iostat command with the -x option to report I/O service times in svc_t output. The iostat utility also reports the same wt, user (us), and system (sy) statistics. See iostat(1M) for more information. When executing in a zone and if the pools facility is active, mpstat(1M) will only provide information for those processors which are a member of the processor set of the pool to which the zone is bound. SunOS 5.11 29 Jun 2005 mpstat(1M)
All times are GMT -4. The time now is 06:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy