Throttling Process Resource Consumption


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Throttling Process Resource Consumption
# 1  
Old 03-02-2009
Throttling Process Resource Consumption

Is there a way of throttling a process resources, something akin to limits but for processes not users? ie I want processX to be restricted in the amount of memory it can consume. For process cpu I guess I can simply nice the process, but total memory consumption is my primary concern.
# 2  
Old 03-02-2009
ulimit in the process shell script or call setrlimit() in C code.
# 3  
Old 03-02-2009
is there an easy way to make this apply across an infrastructure of servers, though? See limits.conf is easier to deploy.

If I have to go around editing init scripts everywhere then this will drive me nuts, even if automatable, as every time any of them upgrades the software the change will be lost and I'll have to go back to editing or automated editing of all the init scripts across all of the servers and and across all distributions... arrrg.

I'd like something more similar to limits.conf but specifying a process name rather than a user name if possible...
# 4  
Old 03-03-2009
a process name == an executable image file

write a shell script that runs the process you want. put a ulimit call in the shell script.
assume the image file name = /usr/local/bin/foo
1. cp /usr/local/bin/foo /usr/local/bin/fooimage
2. create a shell script then cp smallshell.sh /usr/local/bin/foo
The script calls ulimit then runs /usr/local/bin/fooimage

We do this to shut off/turn on ftp and sftp on certain nodes under some conditions. It takes only a few minutes to do this on about 400 blade servers running linux.

You will have to write another small shell script to deploy this across servers.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Process to add mount point in Sun Cluster existing HAplus resource

Hi Well I would like to know step by step process of adding a mountpoint in HAPLUS resource in SUN cluster as I go the below command to add a mount point but not the step by step process of adding a mount point in existing HA Plus resource. clrs set -p FileSystemMountPoints+=<new_MP>... (3 Replies)
Discussion started by: amity
3 Replies

2. HP-UX

Find out most memory consumption process in HP UX

Dear All, I want to find out top 15 memory consumption processes in HP UX. Can anyone give me any idea about it? Kauser (2 Replies)
Discussion started by: makauser
2 Replies

3. AIX

AIX 7.1 on Power 750 is very slow with no high memory or process consumption

Hi, This thread has been posted before on linuxquestions.org, but no answer, maybe because this is unix question and not linux. I'm posting the same thread here, hope I can get an answer from someone in the meantime, I wish I could post of emergency thread but it needs bits which I don't have :... (6 Replies)
Discussion started by: aLuViAn
6 Replies

4. AIX

AIX resources consumption group by process pattern

Hi, I have AIX processes something as below, how to know the resources consumption group by process pattern "price" and "devdb"? eg: CPU RAM WIO price 20% 250M 5% devdb 30% 1000M 8% oracle 2990122 1 0 10:33:39 - 0:00... (1 Reply)
Discussion started by: victorcheung
1 Replies

5. Programming

HELP!!: CPU resource allocation between kernel modules and user mode process

Hi,all: I run my program which consists of one kernel module and one user mode process on a dual core server. The problem here is the kernel module consumes 100% of one core while the user mode process only consumes 10% of the other core, is there any solution that I can assign some computing... (1 Reply)
Discussion started by: neyshule
1 Replies

6. Red Hat

cannot set user id: Resource temporarily unavailable (not open file/open process related)

First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting. First, this is what's running: This is the error when jobs are run or the... (0 Replies)
Discussion started by: Katahdin
0 Replies

7. Shell Programming and Scripting

Shell script to display top 5 process (per cpu consumption)

Hello, I have to create shell script being myself real novice in scripting... I was looking on the Internet for some script examples, but I don't have the basic understanding of the shell. I was trying to do something with “ps” command without success. For exemple total number of... (2 Replies)
Discussion started by: mr_awd
2 Replies

8. Solaris

real memory consumption of a process

hi pmap, prstat and ps gives the RSS which is shared memory. I need to know the consumption of real memory. how to do that? thx (4 Replies)
Discussion started by: melanie_pfefer
4 Replies

9. UNIX for Dummies Questions & Answers

Process Resource Usage

Hi There, I'm trying to find a way to gather resource usage information (CPU, Memory & Virtual Memory) for a single process in a scripted way. I've looked at vmstat & top but I can't figure out how to use them to get the information for a single process. can any one help with this? ... (2 Replies)
Discussion started by: Murph
2 Replies

10. SCO

Ghost Process + CPU consumption

Hi everyone, I have a problem on sco unixware 7.1.4 a Ghost process is consuming cpu usage. rtpm cpu 0 ======--------- cpu 1 ===--------------------- cpu 2 ============================================================----------- cpu 3 ... (1 Reply)
Discussion started by: neal.opperman
1 Replies
Login or Register to Ask a Question