LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-30-2008, 02:17 AM   #1
pkhera_2001
Member
 
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


Hi!

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.

Cheers...

Thanks & Regards
PK
 
Old 06-30-2008, 12:07 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
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, 12:08 PM   #3
prik420
LQ Newbie
 
Registered: Jun 2008
Posts: 18

Rep: Reputation: 0
http://www.kernel.org/pub/linux/libs...am_limits.html

http://www.linuxtopia.org/online_boo...ing_Users.html

these links should be what you're looking for.
 
Old 07-01-2008, 12:39 AM   #4
pkhera_2001
Member
 
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 : http://www.cyberciti.biz/tips/settin...r-process.html

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,
PK
 
Old 07-01-2008, 02:34 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.
 
  


Reply



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 12: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 04:38 PM
core process eating up resources jaggy00 Linux - Newbie 2 04-23-2007 04:11 AM
best config for limited resources tobysaville Linux - General 13 08-19-2003 06:27 PM
limited cpu use of a process (apache) JustinHoMi *BSD 0 01-10-2003 12:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:13 PM.

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