Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Dec 26, 2008 7:29 pm 
Offline
Senior Newbie

Joined: Wed Dec 10, 2008 4:03 am
Posts: 12
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


Last edited by vague312 on Sat Dec 27, 2008 12:11 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Fri Dec 26, 2008 7:55 pm 
Offline
Senior Member

Joined: Wed Feb 13, 2008 2:40 pm
Posts: 126
What is the full command you are running?


Top
   
 Post subject:
PostPosted: Fri Dec 26, 2008 8:09 pm 
Offline
Senior Newbie

Joined: Wed Dec 10, 2008 4:03 am
Posts: 12
Code:
nohup ./paintball2 +set dedicated 2 +set public 1 +exec server.cfg +map tlc &


Top
   
 Post subject:
PostPosted: Fri Dec 26, 2008 8:16 pm 
Offline
Senior Member

Joined: Wed Feb 13, 2008 2:40 pm
Posts: 126
Does it give a lot out output normally? nohup writes to nohup.out normally, maybe you're killing your disk. Try making your line
Code:
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.


Top
   
 Post subject:
PostPosted: Fri Dec 26, 2008 8:19 pm 
Offline
Senior Newbie

Joined: Wed Dec 10, 2008 4:03 am
Posts: 12
gave it a shot we will see in a few minutes

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


Top
   
 Post subject:
PostPosted: Fri Dec 26, 2008 8:21 pm 
Offline
Senior Member

Joined: Wed Feb 13, 2008 2:40 pm
Posts: 126
> 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.


Top
   
 Post subject:
PostPosted: Fri Dec 26, 2008 8:32 pm 
Offline
Senior Newbie

Joined: Wed Dec 10, 2008 4:03 am
Posts: 12
didnt work. At least it only shot up to 93%
any other suggestions man?


Top
   
 Post subject:
PostPosted: Fri Dec 26, 2008 9:39 pm 
Offline
Senior Member
User avatar

Joined: Thu Mar 06, 2008 12:21 am
Posts: 59
vague312 wrote:
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.


Top
   
 Post subject:
PostPosted: Sat Dec 27, 2008 12:48 am 
Offline
Senior Newbie

Joined: Wed Dec 10, 2008 4:03 am
Posts: 12
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


Top
   
 Post subject:
PostPosted: Sat Dec 27, 2008 3:37 am 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
Any reason not to use nice with nohup...?

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


Top
   
 Post subject:
PostPosted: Sat Dec 27, 2008 12:07 pm 
Offline
Senior Newbie

Joined: Wed Dec 10, 2008 4:03 am
Posts: 12
"mjrich"
Code:
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?


Top
   
 Post subject:
PostPosted: Sat Dec 27, 2008 1:11 pm 
Offline
Senior Member

Joined: Fri Feb 18, 2005 4:09 pm
Posts: 594
vague312 wrote:
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


Top
   
 Post subject: For centos
PostPosted: Sat Dec 27, 2008 4:13 pm 
Offline
Senior Member
User avatar

Joined: Thu Mar 06, 2008 12:21 am
Posts: 59
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.


Last edited by weave on Mon Dec 29, 2008 3:19 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Mon Dec 29, 2008 2:49 pm 
Offline
Senior Newbie

Joined: Wed Dec 10, 2008 4:03 am
Posts: 12
woot! Its working

The "apt-get install screen" command worked with debian.
just had to modify my original command line to
Code:
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group