LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-11-2005, 04:05 PM   #1
Grobbendonk
LQ Newbie
 
Registered: Jul 2004
Posts: 24

Rep: Reputation: 0
nice / renice question


Hello,

I've got a game on my system that suffers some minor performance problems. I can make these go away by using renice to take it to priority -1. I am root, so doing this isn't a problem for me (just annoying), but I do have another two users who would love to play the game properly, but can't unless I do a quick su and renice their game.

So, I'm looking for a way that I can get them to run something without root having to interfere. My instincts are to create a wrapper script that they can run, but I don't know how to get it to do the job.

I've played with sudo, but don't want to grant them permission to run renice at any time, and I had a look at chmod +s, but I think that would make them run the game as root (definitely don't want that!).

Any other ideas?

Thanks, Nic
 
Old 08-11-2005, 05:19 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
What game is it, and how does reniceing by 1 level fix it?
 
Old 08-11-2005, 05:30 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938
You should not have to alter the priority. Particularly by any large amounts. Something else will be penalized, and you ought to try to find out what it is.

If you punch a process into better-than-normal priority, sometimes it depends upon some other process that runs at normal-priority and things start to clog up.
 
Old 08-13-2005, 01:21 PM   #4
Grobbendonk
LQ Newbie
 
Registered: Jul 2004
Posts: 24

Original Poster
Rep: Reputation: 0
>What game is it, and how does reniceing by 1 level fix it

Game is Neverwinter Nights. There's a slight jerkiness when starting to rotate the "camera", when opening/closing some of the panels and when there's a lot of activity on screen. The jerkiness goes away with a small renice for the first two issues, and the number of moving objects on screen can double before there's any loss of performance.

Checking top when the game is running is a dead giveaway - it's constantly vying with all the other nice 0 processes. Renicing stops this, without seeming to affect any other process.

>You should not have to alter the priority.
Nope, but it works!

>Particularly by any large amounts.
Hence only one point. I've locked up machines before by misusing renice, so I keep it to a minimum. The game starts at 0 and we renice it to -1.

>Something else will be penalized, and you ought to try to find out what it is.
Well, yes, everything with priority 0 to 20. But this machine is a desktop, for single user use, and when playing, we're not interested in any other process that is running, so it doesn't really matter.

>If you punch a process into better-than-normal priority, sometimes it depends upon some other process that runs at normal-priority and things start to clog up.
Good point - nwn does use the sound and GUI processes, which continue at normal priority, but renicing doesn't affect the game. I will have a look at the process tree when running it later, to see what it is spawning
 
Old 08-13-2005, 02:06 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Why not allow them to sudo and ONLY perform 'renice -n -1 `pidof PROCESS`'. You might not be able to put that directly into the sudoers file, and may need to place it in a script... but then allow them to sudo that script. Or better, create a script that launches the game through nice. 'nice -n -1 su $USER -c GAME'.
 
Old 08-13-2005, 04:05 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
If rotation (graphics stuff) makes the game jerky ...

What CPU, RAM and videocard have you got,
and what driver is X running it with?


Cheers,
Tink
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nice / renice problem g-string 3 Linux - Software 2 09-16-2005 04:53 PM
nice/renice crashes programs make Mandriva 1 04-20-2005 03:03 AM
nice and renice (question) podollb Linux - Software 7 10-19-2004 12:10 PM
Nice and Renice KnightAzul Linux - General 1 09-17-2003 11:59 AM
"nice" vs "renice" Poetics Linux - Newbie 2 07-03-2003 04:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration