Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

limiting cpu usage time for daemons

Status
Not open for further replies.

venkman

Programmer
Oct 9, 2001
467
US
I was wondering how to go about limiting the % of CPU used by certain processes. I've been running hotway, the pop-httpmail gateway daemon, as an xinetd service. Unfortunately, after a couple of uses, hotway starts spawning zombie threads which eat away at my cpu. I've been using cron to regularly kill the extra hotwayd processes, but I was wondering if there was a way to limit the damage done in the interim between the cron job.

I was thinking ulimit might be the way to do it, but I think that only covers user threads.

any ideas?

-Venkman
 
Hello

you might want to use the command nice. Man nice for full instruction , but heres an example:

nice -n 20 /path/some/program

will start the program with the lowest possible priority.

nice -n -19 /path/some/program

will start the program with the highest possible priority.

Cheers

Neil
 
but, it's not a process that I spawn from the command line. The process is started from xinetd. Can nice be worked into that without effecting other processs xinetd spawns... and if so how?

-Venkman
 
oh, and can nice be used to changed the priority of an existing process?

-Venkman
 
I am not sure it can be used for xinetd processes , i have not tried, but the file in xinetd names the binary , so try prefixing it. Or running them as daemons , not from xinetd , and then use nice.

Yes , a running program can be re-niced.

Cheers

Neil
 
oh, and I just realized that in my original post I wrote "zombie threads" when I really meant "zombie processes".

Thanks for the advice Neil. I'll try it out when I get a chance and let you know how it goes. I think renaming the binary called in the xinetd sounds like the best idea to me.

Also, admitedly, I have not checked the hotway site to see what they say. Probably should've checked that out first, but I figured this was a useful thing to learn anyways. If I see anything on the hotway site of interest I'll post it here.

Thanks again,
-Venkman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top