Sponsored Content
Top Forums Shell Programming and Scripting Script with high CPU utilization Post 302341172 by mad_man12 on Wednesday 5th of August 2009 08:12:38 AM
Old 08-05-2009
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 -exec rm {} \;
find /abc/def -name '0*.Z' -mtime +6 -exec rm {} \;

Now the issue is the scripts results in high CPU utilization reaching close to 100%.

How can i optimize my script so that i does not result in high cpu usage.

Please Advice and let me know if any others details are needed.

Note: /abc/def directory contains a lot of files.
 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

10. 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
DBIx::Class::Helper::ResultSet::VirtualView(3pm)	User Contributed Perl Documentation	  DBIx::Class::Helper::ResultSet::VirtualView(3pm)

NAME
DBIx::Class::Helper::ResultSet::VirtualView - Clean up your SQL namespace (DEPRECATED) VERSION
version 2.013002 SYNOPSIS
# note that this is normally a component for a ResultSet package MySchema::ResultSet::Bar; use strict; use warnings; use parent 'DBIx::Class::ResultSet'; __PACKAGE__->load_components('Helper::ResultSet::VirtualView'); # and then in code that uses the ResultSet Join with relation x my $rs = $schema->resultset('Bar')->search({'x.name' => 'abc'},{ join => 'x' }); # 'x' now pollutes the query namespace # So the following works as expected my $ok_rs = $rs->search({'x.other' => 1}); # But this doesn't: instead of finding a 'Bar' related to two x rows (abc and # def) we look for one row with contradictory terms and join in another table # (aliased 'x_2') which we never use my $broken_rs = $rs->search({'x.name' => 'def'}); my $rs2 = $rs->as_virtual_view; # doesn't work - 'x' is no longer accessible in $rs2, having been sealed away my $not_joined_rs = $rs2->search({'x.other' => 1}); # works as expected: finds a 'table' row related to two x rows (abc and def) my $correctly_joined_rs = $rs2->search({'x.name' => 'def'}); DESCRIPTION
This component is will allow you to clean up your SQL namespace. See "NOTE" in DBIx::Class::Helper::ResultSet for a nice way to apply it to your entire schema. DEPRECATED
This component has been suplanted by DBIx::Class::ResultSet::as_subselect_rs. In the next major version(3) we will begin issuing a warning on it's use. In the major version after that(4) we will remove it entirely. METHODS
as_virtual_view Act as a barrier to SQL symbols. The resultset provided will be made into a "virtual view" by including it as a subquery within the from clause. From this point on, any joined tables are inaccessible to ->search on the resultset (as if it were simply where-filtered without joins). See "SYNOPSIS" for example. NOTE
You don't have to use this as a Component. If you prefer you can use it in the following manner: # in code using ResultSet: use DBIx::Class:Helper::VirtualView; my $new_rs = DBIx::Class::Helper::VirtualView::as_virtual_view($rs); THANKS
Thanks to ijw from #dbix-class for the idea for this helper (originally called seal), most of the code, and most of the documentation. AUTHOR
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Arthur Axel "fREW" Schmidt. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-18 DBIx::Class::Helper::ResultSet::VirtualView(3pm)
All times are GMT -4. The time now is 02:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy