Sponsored Content
Top Forums Shell Programming and Scripting what would a script include to find CPU's %system time high and user time high? Post 302630107 by sushwey on Wednesday 25th of April 2012 11:55:44 AM
Old 04-25-2012
Question what would a script include to find CPU's %system time high and user time high?

Hi ,
I am trying to Smilie my head while scripting ..I am really new to this stuff , never did it before Smilie .

how to find cpu's system high time and user time high in a script??


thanks , help would be appreciated !
Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script with high CPU utilization

Hi All, i have a script that finds the file with .txt .zip .Z .gzip that are 3 days old in directory /abc/def and removes them find /abc/def -name '0*.txt' -mtime +6 -exec rm {} \; find /abc/def -name '0*.zip' -mtime +6 -exec rm {} \; find /abc/def -name '0*.gzip' -mtime +6... (3 Replies)
Discussion started by: mad_man12
3 Replies

2. Shell Programming and Scripting

script to generate core if cpu is high

Hi guys, I need a script that will generate a core of a process when the process uses high cpu for a sustained period? So for example if a process is using greater than 80% cpu for more than 30 minutes do "gcore /var/tmp/process.core pid" (1 Reply)
Discussion started by: borderblaster
1 Replies

3. Shell Programming and Scripting

High CPU Utilization of the script

There is a script which processes the incoming files from a particular directory and sleeps if it doesnt find any. Currently, i have been told that eventhough there are no files to process, the CPU utilization is very high. An independent evaluation by advisory specialist has found this script does... (2 Replies)
Discussion started by: nandu
2 Replies

4. Ubuntu

High System CPU Usage

I am running a Dell PE R815 with 4 x AMD 12 core CPUs with 128GB of RAM and a RAID 5 array of 6 SAS disks. This is an HPC application and is definitely CPU bound, however once I run 16 of these processes (thus pinning 16 cores) the work performed slows down dramatically, to maybe 5 or 10% of what... (2 Replies)
Discussion started by: mowmentous
2 Replies

5. Solaris

Find why CPU utlization WAS high yesterday

I want to investigate why CPU utilization was high yesterday on my solaris 10 machine. I have been reported this problem but how can I investigate why CPU utilization went high at that time? :confused: (4 Replies)
Discussion started by: kashif_islam
4 Replies

6. Red Hat

apache high cpu load on high traffic

i have a Intel Quad Core Xeon X3440 (4 x 2.53GHz, 8MB Cache, Hyper Threaded) with 16gig and 1tb harddrive with a 1gb port and my apache is causing my cpu to go up to 100% on all four cores heres my http.config <IfModule prefork.c> StartServers 10 MinSpareServers 10 MaxSpareServers 15... (4 Replies)
Discussion started by: awww
4 Replies

7. Linux

System Went panic after CPU usage high

Hi All, Yesterday my Linux server went panic and even a small command took a lot of time to run. When i monitored pl find the below output Cpu(s): 0.1%us, 98.4%sy, 0.0%ni, 1.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st the time spent on kernel mode is 98 % and also idle time is around 1.5 %...... (4 Replies)
Discussion started by: jegaraman
4 Replies

8. Shell Programming and Scripting

Shell script to monitor process with high CPU

Hi, Linux redhat 5.5 I need to write a kshell script that shows all the process that consume 100% CPU (or more. strange but there are time that top shows higger value that 100) and they are active more than 5 minute. The top command shows all the relevat information: The PID of the cpu ,... (0 Replies)
Discussion started by: yoavbe
0 Replies

9. AIX

Wait time shows high CPU usage

Hi, I can't seem to make sense of this. My wait time is showing really high but vmstat's and topas are showing normal usage. ps aux USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND root 9961810 5680.7 0.0 448 384 - A Dec 16 6703072:12 wait ... (2 Replies)
Discussion started by: techy1
2 Replies

10. Solaris

How can i restrict user high cpu usage?

HI In my M5000 , one of domain is having SAp installed. from today onwards we are facing some stange issue. when we start SAP application, that particular user is taking 95 % of system CP and renaming 5 % is taken by system . because of this reason application is slow. i have 4 CPU(32... (4 Replies)
Discussion started by: bentech4u
4 Replies
Devel::GraphVizProf(3pm)				User Contributed Perl Documentation				  Devel::GraphVizProf(3pm)

NAME
Devel::GraphVizProf - per-line Perl profiler (with graph output) SYNOPSIS
perl -d:GraphVizProf test.pl > test.dot dot -Tpng test.dot > test.png DESCRIPTION
NOTE: This module is a hack of Devel::SmallProf by Ted Ashton. It has been modified by Leon Brocard to produce output for GraphViz, but otherwise the only thing I have done is change the name. I hope to get my patches put into the main Devel::SmallProf code eventually, or alternatively read the output of Devel::SmallProf. Anyway, the normal documentation, which you can probably ignore, follows. The Devel::GraphVizProf profiler is focused on the time taken for a program run on a line-by-line basis. It is intended to be as "small" in terms of impact on the speed and memory usage of the profiled program as possible and also in terms of being simple to use. Those statistics are placed in the file smallprof.out in the following format: <num> <time> <ctime> <line>:<text> where <num> is the number of times that the line was executed, <time> is the amount of "wall time" (time according the the clock on the wall vs. cpu time) spent executing it, <ctime> is the amount of cpu time expended on it and <line> and <text> are the line number and the actual text of the executed line (read from the file). The package uses the debugging hooks in Perl and thus needs the -d switch, so to profile test.pl, use the command: perl5 -d:GraphVizProf test.pl Once the script is done, the statistics in smallprof.out can be sorted to show which lines took the most time. The output can be sorted to find which lines take the longest, either with the sort command: sort -k 2nr,2 smallprof.out | less or a perl script: open(PROF,"smallprof.out"); @sorted = sort {(split(/s+/,$b))[2] <=> (split(/s+/,$a))[2]} <PROF>; close PROF; print join('',@sorted); NOTES
o The "wall time" readings come from Time::HiRes and are reasonably useful, at least on my system. The cpu times come from the 'times' built-in and the granularity is not necessarily as small as with the wall time. On some systems this column may be useful. On others it may not. o GraphVizProf does attempt to make up for its shortcomings by subtracting a small amount from each timing (null time compensation). This should help somewhat with the accuracy. o GraphVizProf depends on the Time::HiRes package to do its timings. It claims to require version 1.20, but may work with earlier versions, depending on your platform. OPTIONS
GraphVizProf has 3 variables which can be used during your script to affect what gets profiled. o If you do not wish to see lines which were never called, set the variable "$DB::drop_zeros = 1". With "drop_zeros" set, GraphVizProf can be used for basic coverage analysis. o To turn off profiling for a time, insert a "$DB::profile = 0" into your code (profiling may be turned back on with "$DB::profile = 1"). All of the time between profiling being turned off and back on again will be lumped together and reported on the "$DB::profile = 0" line. This can be used to summarize a subroutine call or a chunk of code. o To only profile code in a certain package, set the %DB::packages array. For example, to see only the code in packages "main" and "Test1", do this: %DB::packages = ( 'main' => 1, 'Test1' => 1 ); o These variables can be put in a file called .smallprof in the current directory. For example, a .smallprof containing $DB::drop_zeros = 1; $DB::profile = 0; will set GraphVizProf to not report lines which are never touched for any file profiled in that directory and will set profiling off initially (presumably to be turned on only for a small portion of code). INSTALLATION
Just the usual perl Makefile.PL make make test make install and should install fine via the CPAN module. BUGS
Subroutine calls are currently not under the control of %DB::packages. This should not be a great inconvenience in general. The handling of evals is bad news. This is due to Perl's handling of evals under the -d flag. For certain evals, caller() returns '(eval n)' for the filename and for others it doesn't. For some of those which it does, the array "@{'_<filename'}" contains the code of the eval. For others it doesn't. Sometime, when I've an extra tuit or two, I'll figure out why and how I can compensate for this. Comments, advice and questions are welcome. If you see inefficent stuff in this module and have a better way, please let me know. AUTHOR
Ted Ashton <ashted@southern.edu> GraphVizProf was developed from code originally posted to usenet by Philippe Verdret <philippe.verdret@sonovision-itep.fr>. Special thanks to Geoffrey Broadwell <habusan2@sprynet.com> for his assistance on the Win32 platform and to Philippe for his patient assistance in testing and debugging. Copyright (c) 1997 Ted Ashton This module is free software and can be redistributed and/or modified under the same terms as Perl itself. SEE ALSO
Devel::DProf, Time::HiRes. perl v5.14.2 2012-04-02 Devel::GraphVizProf(3pm)
All times are GMT -4. The time now is 07:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy