Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-30-2008, 03:17 AM   #1
Registered: Mar 2006
Location: New Delhi, India
Distribution: Fedora, CentOS, RHEL, Ubuntu
Posts: 67

Rep: Reputation: 18
Exclamation Need to allocate a limited resources to a user/process


We are using RHEL 5.2 on our dual 8 core Xeon servers.

I need to allocate limited resources to a user/process.

If a non-root user executes a program then user/process should not consume more resources than allocated to him.

And if a root user or sudo user executes a program/process then also we would like to limit the resources for that program/process.

I have tried to search for the same on Linuxquestions forum but haven't found this kind of question, so I don't know that this can be possible or not on a Linux based machine.

Please help me know if this can be done and if yes then how, which tool/utility can be used.

Note: We are not using any Virtual Machine so that limited resources can be allocated to a VM. We need to do it native OS installed RHEL 5.2 we some users on it.


Thanks & Regards
Old 06-30-2008, 01:07 PM   #2
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,864

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
You might be able to do what you want with the ulimit command. You would set up the ulimit command in each user's startup bashrc or profile. To get an idea of what resources ulimit can regulate enter these sommands:

ulimit -a

man ulimit

Steve Stites
Old 06-30-2008, 01:08 PM   #3
LQ Newbie
Registered: Jun 2008
Posts: 18

Rep: Reputation: 0

these links should be what you're looking for.
Old 07-01-2008, 01:39 AM   #4
Registered: Mar 2006
Location: New Delhi, India
Distribution: Fedora, CentOS, RHEL, Ubuntu
Posts: 67

Original Poster
Rep: Reputation: 18
thanks for the reply

Hi jailbait and prik420 !

Thanks for the guide, as i go through both ulimit and Pam limit.conf options. It seems that I am able to control a lot of resources.

But I am not able to find any option under ulimit and Pam limit.conf which can bind a process to a single CPU on multicore/multiprocessor systems.

Yesterday I did some google and found we can use CPU affinity for this. We can assign affinity for a process so that it stays only on that processor. There are two types of CPU affinity.
A quick how to is on :

As per this how to, we can assign affinity to processes and for that we need to know the PID of the process, what to do to define affinity to a user so that what ever process a user executes it gets bind to a speficified processor.

Thanks & Regards,
Old 07-01-2008, 03:34 AM   #5
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 16,097

Rep: Reputation: 2251Reputation: 2251Reputation: 2251Reputation: 2251Reputation: 2251Reputation: 2251Reputation: 2251Reputation: 2251Reputation: 2251Reputation: 2251Reputation: 2251
In the past I have used cpusets - now supplanted by cgroups. If you have a (reasonably) recent kernel source tree have a look at ../Documentation/cgroups.txt, else ../Documentation/cpusets.txt will give you the idea.


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
allocate a CPU for a process out of 4 CPUS procfs Linux - Newbie 7 12-31-2007 01:28 AM
PCI: Failed to allocate memory resources to #6:100000:4400000 for 0000:01:00.0 jungle_sri Linux - General 0 05-05-2007 05:38 PM
core process eating up resources jaggy00 Linux - Newbie 2 04-23-2007 05:11 AM
best config for limited resources tobysaville Linux - General 13 08-19-2003 07:27 PM
limited cpu use of a process (apache) JustinHoMi *BSD 0 01-10-2003 01:51 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration