|
Home > Archive > Unix Shell > January 2006 > Limit CPU usage when executing shell script
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Limit CPU usage when executing shell script
|
|
| Reuben 2006-01-23, 6:13 pm |
| Hi all,
I have a scheduled shell script that does a filter on my /var/messages
file every day. This process seems to utilizes 100% of the CPU, and
makes the server unresponsive during this period. Is there a way I can
limit the amount of resources the script can use?
Thanks in advance
Reuben
reuben@presence-systems.com
| |
| Stephane Chazelas 2006-01-23, 6:13 pm |
| On 23 Jan 2006 08:01:12 -0800, Reuben wrote:
> Hi all,
>
> I have a scheduled shell script that does a filter on my /var/messages
> file every day. This process seems to utilizes 100% of the CPU, and
> makes the server unresponsive during this period. Is there a way I can
> limit the amount of resources the script can use?
[...]
Increase its niceness, so that it has a lower priority than
other processes. Bound CPU usage doesn't make sense.
nice -n 20 your-script
(20 is the highest niceness (resulting into the lowest
priority)).
--
Stephane
| |
| libdave@gmail.com 2006-01-23, 6:13 pm |
| nice(1)
|
|
|
|
|