08-05-2012
There is no genuine way of restricting processor resources on a per-user basis, just on a per-process basis. Per process you can use "nice"/"renice", but this is not limiting the resources in an absolute way either, just in relation to all the other processes.
If you are looking for a "of the 5 available processors this process is only entitled to use 1"-solution: such a thing doesn't exist, at least not in general. In AIX there is the bindprocessor command (look at the man page of this command and search for "processor affinity AIX" in your favourite search engine to find out more), which comes close to this, i don't know if other OSes have a similar mechanism.
nice manipulates a process' priority (to be precise: it manipulates the way the kernel assigns a priority to said process): lets assume we have only one processor and several processes competing for its use. The Unix kernel would let the first process have the the processor for some time, then stop it, assign the processor for the same time to the next process, etc., until all the processes had their turn, then start over with the first one again. As this happens in rapid succession it looks like all the processes run simultaneously, but in fact they do not.
With priority entering the picture not all the processes will be given equal time any more. A process with high priority will get the processor for a longer time then a process with lower priority, so that a high-priority-process seems to run faster than a low-priority process.
Still, as long as all the processes' CPU demands can be satisfied every process gets as much as it wants, regardless how much that is. Even the lowest priority process can get 99% CPU as long as no other process demands it.
You might want to read the man pages for nice and renice to learn more about "process scheduling" and "process priority" (use these as starting points for web research) in the Unix kernel.
For limitations on a per-user basis there is "ulimit", but this does not limit processor use, only file size and memory usage. You may want to read the man page for ulimit too to see what you can do with it. Notice there are "hard" and "soft" limits. Basically, hard limits are imposed by the root user and the user cannot change them. Soft limits are also imposed by the root user, but can be changed by the user himself until reaching the hard limit, which is the absolute upper limit the user (and his processes) can use. Usually there is a hard limit somewhat higher than the soft limit and the difference serves as contingency for especially demanding situations. Users should be able to do their usual work within the soft limits and if they can't these values need rework.
I hope this helps.
bakunin
Last edited by bakunin; 08-05-2012 at 08:12 AM..
10 More Discussions You Might Find Interesting
1. Programming
how can i monitor usages of CPU, Memory, Hard disk etc. under SUN Solaries
through a c program or java program
i want to store that data into database so i can show it graphically
thanks in advance (2 Replies)
Discussion started by: Gajanad Bihani
2 Replies
2. UNIX for Dummies Questions & Answers
I would like to change the password requirements for all our AIX 5.2 logins but am having trouble finding a place where I can set the rules for everyone at the same time. I know I can go user by user in smit passwords but is there a way to create rules for everyone at the same time?
Thanks,... (2 Replies)
Discussion started by: drathbone
2 Replies
3. Programming
Please tell me solaris functions/api for getting following information
1- Function that tells how much memory used by current process
2- Function that tells how much memory used by all running processes
3- Function that tells how much CPU is used by current process
4- Function that tells how... (1 Reply)
Discussion started by: mansoorulhaq
1 Replies
4. HP-UX
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies
5. Solaris
Hi,
I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP.
I want the oids for above tasks.
can you please tell me that
Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies
6. Solaris
Hello Friends,
On one of my Solaris 10 box, CPU usage shows 100% using "sar", "vmstat". However, it has 4 CPUs and prstat and glance are not showing enough processes to justify high CPU utilization.
=========================================================================
$ prstat -a
... (4 Replies)
Discussion started by: mahive
4 Replies
7. AIX
How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies
8. AIX
Hi!
Is there any way to balance CPU usage between users on percentage basis? Something like Resource Manager in Oracle databases.
Regards.
---------- Post updated at 02:17 PM ---------- Previous update was at 02:09 PM ----------
Workload Manager?
---------- Post updated at 03:44 PM... (0 Replies)
Discussion started by: bas_ua
0 Replies
9. Shell Programming and Scripting
Hi,
I need to work on restricting the Linux commands to the ADMIN user to some extent. It means for example, Admin users should not use passwd command to change the password of "root" or other important accounts like oracle, etc.,
So, I want to know which commands should be restricted upto which... (5 Replies)
Discussion started by: Dpu
5 Replies
10. AIX
Dear All,
One production Server is affected by high usage.
Application is slow now. Please guide me how to solve it?
NMON Report shows full cpu usage.
Here im posting some server details.
bash-3.2# lparstat -i
Node Name : *********
Partition Name ... (6 Replies)
Discussion started by: Thala
6 Replies