LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-13-2008, 11:51 PM   #1
SAMPCam
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Rep: Reputation: 0
Process Priorities and Linux.


I'm having a slight problem..

Currently I'm running several applications on a server. It's a 2.6.21.3 Linux kernel with Preemption and a 1000Hz kernel. I have a highly CPU intensive application. However, when the application starts using a lot of CPU usage (above 80% of one core), Linux seems to adjust the process priority. I need this to have as consistent of a priority as possible.

Basically:

I need to squeeze every ounce of performance out of this server as possible without setting CPU priority, however, the kernel isn't making that possible as it's changing the application to a low priority.

How can i go about changing this?

Thank you.

Last edited by SAMPCam; 03-14-2008 at 01:28 PM. Reason: typo
 
Old 03-14-2008, 01:13 AM   #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
Hi, welcome to LQ!

Quote:
Originally Posted by SAMPCam View Post
I'm having a slight problem..

Currently I'm running several applications on a server. It's a 2.6.21.3 Linux kernel with Preemption and a 1000Hz kernel. I have a highly CPU intensive application. However, when the application starts using a lot of CPU usage (above 80% of one core), Linux seems to adjust the process priority.
How did you assess that?


Quote:
Originally Posted by SAMPCam View Post
I need to squeeze every ounce of performance out of this server as possible without setting CPU priority, however, the kernel isn't making that possible as it's changing the application to a high priority.
Which application is that? Surely not the same one as you
suggested above that it's throttling it?


Cheers,
Tink

Last edited by Tinkster; 03-14-2008 at 01:14 AM.
 
Old 03-14-2008, 01:28 PM   #3
SAMPCam
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Hi,

Thanks for your reply and the warm welcome.

Well, the kernel priority (PR) goes up. (as in the number, higher the number, lower the priority). nice stays the same however.

The application is the infamous Source Dedicated Server.

I also believed I made an error in the post above that might have confused you. "kernel isn't making that possible as it's changing the application to a high priority."

I meant "low priority" in that statement. Sorry.

Last edited by SAMPCam; 03-14-2008 at 01:30 PM.
 
Old 03-16-2008, 01:16 PM   #4
SAMPCam
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
Bump. Any ideas?
 
Old 03-16-2008, 01:29 PM   #5
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,334

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
Quote:
Originally Posted by SAMPCam View Post

Currently I'm running several applications on a server. It's a 2.6.21.3 Linux kernel with Preemption and a 1000Hz kernel. I have a highly CPU intensive application. However, when the application starts using a lot of CPU usage (above 80% of one core), Linux seems to adjust the process priority. I need this to have as consistent of a priority as possible.

Basically:

I need to squeeze every ounce of performance out of this server as possible without setting CPU priority, however, the kernel isn't making that possible as it's changing the application to a low priority.
You are asking for two conflicting goals. If you want to maximize the speed that the application runs then you need to set the application as the highest priority application process in the machine.

If you are trying to get the maximum performance out of the server then you need to let Linux dynamically adjust all of the processes' priorities to get the maximum amount of work through in the shortest possible time. If you are trying for maximum server throughput then Linux will push cpu bound processes toward the bottom of the priority queue.

---------------------
Steve Stites
 
Old 03-16-2008, 02:18 PM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I agree, it's impossible without setting priority. You must set the priority to be higher than the rest. I don't understand why you don't want to up the process priority, can you explain. I mean this is what process priority was designed for ... so ... I don't get it.

EDIT:
I don't really see what you're trying to do, but if you must not change the process priority:
1) Try changing your IO scheduler. You can change these on the fly, no need to recompile the kernel

The following will require kernel re-compile:
2) If you running a server, why not 'No Forced Preemption (Server)' and Timer Frequency as '100 Hz' (or 250 Hz if it's not 100 % a server), the setup you are currently running is designed for desktops ...

Last edited by H_TeXMeX_H; 03-16-2008 at 02:28 PM.
 
Old 03-16-2008, 08:26 PM   #7
SAMPCam
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
The reason why I don't want to set the process priority is because the process don't run properly with a higher priority.
 
Old 03-16-2008, 09:20 PM   #8
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 happens when "the process don't run properly" ?



Cheers,
Tink
 
Old 03-16-2008, 10:08 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
When I've needed to isolate workload(s) to CPU boundaries, I have used cpusets - now subsumed into control groups.
Might work for you - when you can guarantee a particular CPU/core to only that task, you will find it will tend to run unhindered. Depends if you want it to have all of an engine, and if 1 is enough (you can add more engines to the group in need).
 
Old 03-18-2008, 09:46 PM   #10
SAMPCam
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
When I say the application doesn't work properly, I mean it freezes up randomly for a couple seconds.

Thanks for the insight syg00, I'll look into it.
 
Old 03-18-2008, 10:30 PM   #11
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
Your processes could be freezing because of your fiddling with the priorities.

Let everything run at normal priority. If you're having "freeze-ups" long enough for you to perceive as a human, it has nothing at all to do with process priorities.

Generally, the dispatcher will distinguish between "CPU-bound" processes that tend to consume their full time-slice, and "I/O-bound" processes that tend not to.

CPU-bound processes decline in priority, but that doesn't mean they get less attention from the CPU! It just means that I/O-bound processes get to play through... because they're almost certain to start another I/O operation and go right back to sleep again. CPU-bound processes absorb all the time they can use.
 
Old 03-20-2008, 04:16 PM   #12
SAMPCam
LQ Newbie
 
Registered: Mar 2008
Posts: 6

Original Poster
Rep: Reputation: 0
The application freezes for about 1 second as it only freezes when the process priorities are set. The CPU usage spikes up to 100% for that short period of time which causes the freeze. That's bad when you're trying to run a high-performance game server. However, if you don't set the CPU priority, once it reaches around 80% CPU, the Linux kernel PR goes up, and then it starts to lag really bad, constantly.
 
Old 03-20-2008, 04:44 PM   #13
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
have you tried what I said above ? it may help
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Poll: Priorities for Linux and OSS pixellany Linux - General 44 03-13-2007 08:18 AM
Possible Poll on Linux Priorities pixellany Linux - General 38 02-24-2007 03:09 PM
Can you change thread priorities in Linux? jmyrtle Linux - General 2 03-23-2004 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:00 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