limiting nohup cpu usage?

mornin!

Im running a game server off my linode and was wondering if there was a way to limit the nohup commands cpu usage?

If i keep my putty connection open without nohup the usage hovers around +- 10% with players connected but when i start the program with nohup it automatically darts up to 100% usage.

plz keep in mind im still learning

**edit

system specs

im currently running debian 4 for my destro with a 256MB swap image.

thanks

–- Vague

13 Replies

What is the full command you are running?

nohup ./paintball2 +set dedicated 2 +set public 1 +exec server.cfg +map tlc &

Does it give a lot out output normally? nohup writes to nohup.out normally, maybe you're killing your disk. Try making your line

nohup ./paintball2 +set dedicated 2 +set public 1 +exec server.cfg +map tlc > /dev/null 2>&1 &

to send the output to a black hole.

gave it a shot we will see in a few minutes

what does the ending addon do if you dont mind me asking?

> is the "redirect output" character. /dev/null is where to send it to, in this case a black hole. "2>&1" means "send standard error to the same place as standard output" which is /dev/null in this case. & you know.

didnt work. At least it only shot up to 93%

any other suggestions man?

@vague312:

didnt work. At least it only shot up to 93%

any other suggestions man?

Use screen (that's the name of the program). Probably have to install it. If you get logged out, accidently or otherwise, it should just detach the session and continue working. Then you can restore it with "screen -r" later.

as much as i would like to install screen im afraid its beyone my capabilities at this time. Dont know what it is i just cant find any dumbed down instillation instructions.

ill give it another shot tomorrow

Any reason not to use nice with nohup…?

nohup nice -20 ./paintball2 +set dedicated 2 +set public 1 +exec server.cfg +map tlc > /dev/null 2>&1 &

"mjrich" nohup nice -20 ./paintball2 +set dedicated 2 +set public 1 +exec server.cfg +map tlc > /dev/null 2>&1 &
still shootin up. I updated my original post with my system specs.

Are there any destros than have screen pre installed?

@vague312:

Are there any destros than have screen pre installed?

This command:

sudo apt-get install screen

on Ubuntu told me it was already installed and at the latest version. Try the same command on Debian.

(or as root: apt-get install screen)

James

Or if you runnning Centos, try

yum install screen

Then "man screen" for options and commands. The idea is when screen is running you send commands to it with a control key of some sort, default is ctrl-a. So like ctrl-a D will detach the screen and leave it running on its own.

screen also allows you to run multiple shells in one logon. Used to be a must-have back in old terminal dial-up days but now you can just open several ssh sessions in. It still has its uses.

man screen for the lowdown after installing.

woot! Its working

The "apt-get install screen" command worked with debian.

just had to modify my original command line to

screen ./paintball2 +set dedicated 2 +set public 1 +exec server.cfg +map tlc &

The cpu usage is now hovering below 10% even with 12 players.

much thanks for the help with this guys.

–- Vague

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct