Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
application dependant CPU allocation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
trossachs
Veteran
Veteran


Joined: 22 Jan 2004
Posts: 1204
Location: London

PostPosted: Sat Jun 12, 2004 1:37 am    Post subject: application dependant CPU allocation Reply with quote

Sounds complex. Is there any way that I can allocate let's say 80% of the systems CPU resources to "general" processing such as perl scripting and the like which normally demands as much of the CPU as will be made available. And then to reserve the remaining 20% to specific "real time" applications such as VIM where any loss of CPU availability is frowned upon by users?

Or will I need to look at a bigger box such as SPARC or something along these lines?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54850
Location: 56N 3W

PostPosted: Sat Jun 12, 2004 2:24 pm    Post subject: Reply with quote

JulesF,

You can nice your pearl process(es) so it yeilds the CPU more readily, but not set a hard split.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
trossachs
Veteran
Veteran


Joined: 22 Jan 2004
Posts: 1204
Location: London

PostPosted: Sat Jun 12, 2004 6:16 pm    Post subject: Reply with quote

"Nice?" I'm afraid I don't quite understand NeddySeagoon. Is there some sort of menu option where I can choose which apps get access to different parts of the CPU?
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Sat Jun 12, 2004 6:23 pm    Post subject: Reply with quote

man nice:
NAME nice - run a program with modified scheduling priority.


Or have a look at verynice:

app-admin/verynice
Latest version available: 1.1
Homepage: http://www.tam.cornell.edu/~sdh4/verynice/
Description: A tool for dynamically adjusting the nice-level of processes

In short, by this you can give certain processes priority over others.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54850
Location: 56N 3W

PostPosted: Sat Jun 12, 2004 6:34 pm    Post subject: Reply with quote

JulesF,

All processes have a nice value associated with them. Running top will show it in the column headed NI.

The more positive the "nice" value, the nicer the process is to other processes on the system. Interactive processes and processes spawned by users get a default nice of 0. Users can adjust the value for themselves in the range of positive values. Only root may assign negative (nasty??) values to nice. (Be careful if you try this at home)

The upshot of all this is that you can tune system behaviour this way by having the system assign a positive nice value to batch (background) jobs when they are launched.

For example, I run Seti At Home, which is CPU intensive at a nice of 19. It gets out of the way for everything except other tasks with the same nice value. This gives me a CPU load of 1.00 or more becuase S@H is always ready to run but the system does compiles in good time and is always responsive.

See man nice
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Sun Jun 13, 2004 9:14 am    Post subject: Reply with quote

Porbably unrelated, but can someone explain to me what the ulimit setting for CPU time does?
if you do a ulimit -a:
Code:
core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 1024
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) 8192
cpu time             (seconds, -t) unlimited
max user processes            (-u) 512
virtual memory        (kbytes, -v) unlimited

ulimit is a bash internal command, and the bash manpage is not very informative of the values. All the others are pretty self-explanatory, but how does the "cpu time" limit work?
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum