in reply to Resource Hog

seeing your code, i assume you're on a unix like machine. Try to set the nice level of your program. If it's the only running process, it still takes a lot of cpu-time, but if another program with a higher nice level gets in, it reduces it's load.

Since you use system commands, you could run them like
... if ($nicelevel ne "") { $cmd = "nice -$nicelevel " . $cmd; } system $cmd;

Or You could look here

"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

Replies are listed 'Best First'.
Re^2: Resource Hog
by tc1364 (Beadle) on Apr 06, 2005 at 21:24 UTC
    Yes, the code is running on a Unix machine and the nice level is 1 when observing the performance using the "top" command. The other code running on the server has a nice level of zero. Maybe I am reading the "top" command wrong but under the CPU column, the percentage reaches 40 percent at times for these large table dumps with a CPU time reaching 6 minutes. There is always some other processes running on this server.