LinuxQuestions.org
Visit the LQ Articles and Editorials section
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: 20

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: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

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

Rep: Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071Reputation: 1071
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: 20

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
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 117Reputation: 117
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: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,962
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 11:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration