Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support CPU and memory utilization of a process, by process name Post 302684675 by ggayathri on Friday 10th of August 2012 12:17:52 AM
Old 08-10-2012
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
 

10 More Discussions You Might Find Interesting

1. AIX

cpu utilization of a process

Hi, How can i find out the average cpu utilization of a particular long-running process in AIX? is there some command for this Thanks (2 Replies)
Discussion started by: iam
2 Replies

2. Shell Programming and Scripting

Memory and CPU utilization process

Hi, I need to check which process in linux is taking high memory and which process is taking high cpu usage. Regards, Bash (4 Replies)
Discussion started by: learnbash
4 Replies

3. 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

4. UNIX for Dummies Questions & Answers

Getting CPU utilization and memory for a process

I am trying to get cpu util and memory occupied for a process. I use these (I am showing output also): using top ---------- $ top p 25272 d 5 top - 01:52:17 up 2 days, 21:28, 2 users, load average: 0.02, 0.05, 0.06 Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie... (5 Replies)
Discussion started by: radiatejava
5 Replies

5. AIX

High CPU utilization by a pro*C process

Hi , we upgarded our AIX from 5.3 to 6.1 and upgraded our xlc compiler from ver 6.0 to 9.0 . After this upgrade one of our pro*C program is utilizing around 20% of the CPU. Before upgarde its using only 0.2 %. when i try to debug using the truss command i got the below error. $... (6 Replies)
Discussion started by: mugunthanvh
6 Replies

6. UNIX for Dummies Questions & Answers

Get CPU,Memory utilization by process id

Hi , We need to get the CPU% and Memory utilization of process by process id. Is there any way to do get them ? I tried few commands like top -p <PID> , but am getting error "Quitting top: pset <PID> doesn't exist" also i tried with ps -eo option but am getting error "ps: illegal option --... (1 Reply)
Discussion started by: suresh_g
1 Replies

7. HP-UX

Get CPU,Memory utilization by process id

Hi , We need to get the CPU% and Memory utilization of process by process id. Is there any way to do get them ? I tried few commands like top -p <PID> , but am getting error "Quitting top: pset <PID> doesn't exist" also i tried with ps -eo option but am getting error "ps: illegal option --... (5 Replies)
Discussion started by: suresh_g
5 Replies

8. AIX

Checking CPU utilization by db2sysc process

Hi, I am trying to write a script which will fire alert mail to dba ( db2dba) when there process will utilize CPU more than 90%. But I am unable to do so. I am using following command to calucate CPU utilization be db2sysc process : ps -eo pcpu,pid,comm | grep -i db2sysc | awk '{ SUM+=$1;... (0 Replies)
Discussion started by: niteshtheone
0 Replies

9. Shell Programming and Scripting

Checking CPU utilization by db2sysc process

Hi, I am trying to write a script which will fire alert mail to dba ( db2dba) when there process will utilize CPU more than 90%. But I am unable to do so. I am using following command to calucate CPU utilization be db2sysc process : ps -eo pcpu,pid,comm | grep -i db2sysc | awk '{ SUM+=$1;... (6 Replies)
Discussion started by: niteshtheone
6 Replies

10. Solaris

[DOUBT] Memory high in idle process on Solaris 10 (Memory Utilization > 90%)

Hi Experts, Our servers running Solaris 10 with SAP Application. The memory utilization always >90%, but the process on SAP is too less even nothing. Why memory utilization on solaris always looks high? I have statement about memory on solaris, is this true: Memory in solaris is used for... (4 Replies)
Discussion started by: edydsuranta
4 Replies
pthread_mutexattr_getspin_np(3T)										  pthread_mutexattr_getspin_np(3T)

NAME
pthread_mutexattr_getspin_np(), pthread_mutexattr_setspin_np(), pthread_mutex_getyieldfreq_np(), pthread_mutex_setyieldfreq_np(), pthread_mutexattr_disable_handoff_np(), pthread_mutex_disable_handoff_np() - get and set mutex spin and yield frequency attributes; disable mutex-specific or process-wide mutex handoff mode SYNOPSIS
PARAMETERS
attr Pointer to the mutex attributes object whose attributes are to be set/retrieved. spin This parameter either specifies the new value of the spin attribute (set function) or points to the memory location where the spin attribute of attr is to be returned (get function). yield This parameter either specifies the new value of the yield frequency process-wide attribute (set function) or points to the mem- ory location where the yield frequency process-wide attribute is to be returned (get function). DESCRIPTION
These attributes are used to tune the mutex locking behavior for optimized application performance on multiprocessor systems. For and the attributes object attr must have previously been initialized with the function before these functions are called. Attribute: spin Mutexes can be initialized with a spin value which is used by for busy-wait iterations on the mutex lock. It is effective only on multi- processor systems. It is ignored on uniprocessor systems. For bound threads, the procedure to block on a busy mutex is quite costly. On a multiprocessor system, the thread holding the mutex may be a few instruction cycles away from releasing it. By performing a brief busy-wait before actually blocking, the lock path can avoid a great deal of overhead in these situations. For many applications, these situations are not rare. Consider a mutex used to protect a short sequence of code (e.g., to increment a counter). The mutex is held only for a few instruction cycles (plus the function call overhead for The ability to set the spin attribute allows the application writer to adjust the busy-wait to suit the duration of the common-case criti- cal section protected by each mutex. The legal values for the spin attribute are: The function will busy-wait on the mutex lock for the specified number of iterations before blocking the thread, unless the lock is acquired sooner. Larger spin values would be appropriate for mutexes associated with longer critical sections. Inhibits blocking on the mutex lock altogether. The function will busy-wait on the mutex lock until it is acquired. Uses a built-in default value for the number of busy-wait iterations. Attribute: yield Note that the yield attribute is not a per-mutex attribute, but is process-wide. That is, it affects the behavior of all mutexes. The yield attribute specifies, for the busy-wait, how frequently the processor should be yielded (via allowing other threads to execute. When the number of threads exceeds the number of processors in a system, a busy-wait on a mutex can sometimes have an adverse effect. The busy-wait itself can prevent the thread holding the lock from completing the associated critical section of code. By yielding the proces- sor on occasion, the thread attempting the lock may allow the thread holding the lock to reach the point at which it can release the lock. However, it still avoids the costly path to block on the mutex. The legal values for the yield attribute are: The busy-wait loop in will yield the processor after each specified number of iterations of the spin loop (where the total number of iterations is con- trolled by the per-mutex spin attribute). Inhibits yielding in the mutex lock altogether. Uses a built-in default value for the frequency of yields in the busy-wait loop. The and functions are provided for binary compatibility purposes only. They will not have any noticeable effect on mutexes. RETURN VALUE
and return the following values: Successful completion. Failure. The returned value is an error number defined in the ERRORS section. (The variable is not set). ERRORS
If an error is detected, and return one of the following error numbers. The value specified by attr, spin, or yield is invalid. was called after the process became multithreaded. WARNINGS
The settings of the spin and yield attributes can, as well as improve application performance, easily lead to degraded performance. The CPU consumption of the application may be increased. Settings which work well for a small number of threads may do poorly for larger num- bers of threads. The optimal settings will vary depending upon hardware and operating system configuration. Minor changes in the applica- tion itself may require retuning of these attributes. The programmer must analyze performance carefully to obtain an understanding of mutex contention within the application. Then, experiment with different attribute values, evaluating how mutex contention is affected, response time, and CPU consumption. AUTHOR
and were developed by HP. SEE ALSO
pthread_create(3T), pthread_mutex_init(3T), pthread_mutexattr_init(3T), rtsched(2) STANDARDS CONFORMANCE
Pthread Library pthread_mutexattr_getspin_np(3T)
All times are GMT -4. The time now is 08:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy