High CPU Utilization of the script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting High CPU Utilization of the script
# 1  
Old 04-15-2010
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 language character set conversion(results can be seen after the message) . But there is no conversion done explicitly as such, but, there are lot of display messages in the script (echo "chinese message") , does it cause the language character set conversion as pointed by the advisor? also, currently there is a sleep of 5 secs in the script, if i increase it to 60 seconds, does it make a difference to the performance?

Code:
Profile: /usr/lib/libc.a[shr.o]

Total % For All Processes (/usr/lib/libc.a[shr.o]) = 7.94

Subroutine % Source 
========== ====== ====== 
.wctomb 2.79 ../../../../../../../src/bos/usr/ccs/lib/libc/wctomb.c
.mbtowc 2.57 ../../../../../../../src/bos/usr/ccs/lib/libc/mbtowc.c


Profile: /usr/lib/libi18n.a[shr.o]

Total % For All Processes (/usr/lib/libi18n.a[shr.o]) = 6.76

Subroutine % Source 
========== ====== ====== 
.__wcstombs_std 3.40 ../../../../../../../src/bos/usr/ccs/lib/libi18n/__wcstombs_std.c
.wctomb 1.28 glink.s 
.__mbtowc_iso1 1.06 ../../../../../../../src/bos/usr/ccs/lib/libi18n/__mbtowc_iso1.c
.__wctomb_iso1 1.01 ../../../../../../../src/bos/usr/ccs/lib/libi18n/__wctomb_iso1.c


edit by bakunin: please enclose code, quoted output and similar things into "code"-tags like i did for you now. Thanks.

Last edited by bakunin; 04-15-2010 at 06:21 AM..
# 2  
Old 04-15-2010
Quote:
Originally Posted by nandu
Currently, i have been told that eventhough there are no files to process, the CPU utilization is very high.
To help you in this we would have to have a look at your script. Without concrete analysis of concrete code all suggestions will be vague at best and misleading at the worst.

Quote:
Originally Posted by nandu
also, currently there is a sleep of 5 secs in the script, if i increase it to 60 seconds, does it make a difference to the performance?
A sleep is not all too taxing on the systems resources so probably CPU load will drop overall because the taxing parts of your script will not be executed as often as before.

As you might notice the amassed use of "might", "could", "probably" and similar words point to a lot of uncertainty on this side of the keyboard. What is really going on can only be analyzed when you show the facts instead of second-hand-impressions of some hearsay. Maybe your quoted consultant is correct, maybe he is completely wrong - its simply impossible to find out given the data presented by you.

bakunin
# 3  
Old 04-15-2010
Attached is the code related to the script.

This script is called from another one with a single parameter(1-8).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Kswapd high cpu utilization.

Hi, Please suggest how to troubleshoot, kswapd is utilizing high cpu? also wanted to know which parameters are important and needs to be added with sar command for monitoring the performance of Linux (Oracle 5.8 -64 bit Please guide me. I am facing the issue where server is getting... (0 Replies)
Discussion started by: manoj.solaris
0 Replies

2. Red Hat

High CPU Utilization

Hi Experts, I need to understand few basic things regarding top command result from one of the node i have collected: Cpu0 : 4.6%us, 2.0%sy, 0.0%ni, 91.4%id, 1.3%wa, 0.3%hi, 0.3%si, 0.0%st Cpu1 : 0.0%us, 0.3%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Cpu2 : ... (5 Replies)
Discussion started by: mackjack87
5 Replies

3. UNIX for Advanced & Expert Users

[Solved] High CPU utilization

Hi, i am observing few processes taking high CPU and when i got some more detials about them it looks like this PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 9452 xmp 25 0 16736 1224 860 R 100.0 0.0 903:54.18 ffmpeg -i - 9777 xmp 25 0 16736 1224 ... (1 Reply)
Discussion started by: Siddheshk
1 Replies

4. Shell Programming and Scripting

Gzip with high CPU utilization

Hello all, I am very new to unix and trying to solve this problem. I have cluster of 3 nodes. when I run TOP command on each server, I see a two GZIP processess with very high CPU utilization even,if I don't go backups or unzipping. Can somebody tell me what is the problem, I don't want... (1 Reply)
Discussion started by: nnani
1 Replies

5. UNIX for Advanced & Expert Users

high cpu utilization

good morning. just wanted to ask if there's a way to check what causes the high cpu utilization of a server for the past 2 months? My jffnms report resulted to high utilization for a specific server last month. is there a way to check via a command line? thanks (9 Replies)
Discussion started by: lhareigh890
9 Replies

6. Shell Programming and Scripting

script to check high cpu utilization for java process

Hello Team, I need help in preparing script to check for high cpu utilisation for java process. I have many java process on my system which consumes high cpu so i have to monitor it using script. ---------- Post updated 12-10-10 at 02:21 AM ---------- Previous update was 12-09-10 at... (1 Reply)
Discussion started by: coolguyamy
1 Replies

7. Solaris

vsh is high - cpu utilization

Hi, I am working on a solaris app processor and the vsh goes high from time to time. I have executed various ps commands and switches and have found that it looks like the rlogind daemon is terminating vsh and not cleaning up after itself. There are also something like 10 zombies hanging around... (2 Replies)
Discussion started by: troystevens
2 Replies

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

9. AIX

High CPU utilization

Hi am facing high cpu utilization on my sybase server. I have P550 Number Of Processors: 4 Processor Clock Speed: 1656 MHz CPU Type: 64-bit Kernel Type: 32-bit LPAR Info: 1 65-D837E Memory Size: 7840 MB in topas it shows Name PID CPU% PgSp Owner dataserv 565264 ... (1 Reply)
Discussion started by: vjm
1 Replies

10. Solaris

High CPU Utilization

Good morning, I need some help figuring out what's eating up my cpu. My application can't get enough cpu to do its job. this is a sunfire V440 2CPU's at 1/593 GHZ with 8GB of memory. In the morning hours the box is at less than 3%. I can't figure out what else is using the CPU. We use foglight and... (2 Replies)
Discussion started by: bbouhaik
2 Replies
Login or Register to Ask a Question