How can I explicitly allocate resources (from both cpu and physical memory) to a particular side e.g. Network or to a Process.
Thank You
How can I explicitly allocate resources (from both cpu and physical memory) to a particular side e.g. Network or to a Process.
Thank You
Generally speaking, processes will take as much of both CPU and network bandwidth as they can, relative to the rest of the system. You can't, to my knowledge, explicitly give one process a certain amount of CPU speed like you can with virtual machines.
What you can do is adjust the scheduling priority of the process using "nice", though, as Crankyadmin mentioned. According to the "nice" scale, programs run from 19 (the least priority) to -20, the highest priority, and programs typically run at 0.
Notice that non-root users can only, by default, adjust their programs in the 19-0 range. Only the superuser can schedule priorities below 0 (adjust this default using ulimit in /etc/profile, but ONLY do it if you know what you're doing).
To run a new process at a specific nice level, do
This runs the command at a nice level of 10. The $ indicates that it's a regular user. Here's what happens when you try to set a higher nice level:
Now, as root, we succeed
To change the nice level of an already-running process, use "renice". So if I wanted my firefox session to go faster (dumb idea), I would do this:
Be careful doing this. Every time a process spawns a child process, that child process inherits the parent process's nice level. This means that if firefox (in my case) goes berserk, the system will probably go with it. That's why the maximum priority a user can change to is 0.
Be careful.
ulimits and nice :D
cpusets are a relatively new Linux feature, I haven't played with it yet, but it sounds interesting. Here's some linkage:
http://www.bullopensource.org/cpuset/
http://oss.sgi.com/projects/cpusets/