Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I would like to limit the resource (CPU, Memory, and network bandwidth) consumption of processes on the same server. And it will be good if I can migrate processes from one server to another.

I think I am looking for some light-weight virtualization. I found LXC is a good choice. But our 2.6.18 kernel does not support LXC. It is a shared cluster, so, I am not allowed to upgrade the kernel. And I think the "setrlimit" system call will only send signals to the processes when the budget is reached rather than limit the resource consumption as a virtual machine does (Please correct me if I am wrong). Any recommendation for this task?

Thanks!

share|improve this question
1  
Check out OpenVZ and Linux-VServer –  MaxMackie Dec 15 '11 at 6:54
add comment

1 Answer

up vote 1 down vote accepted

Some of these resources can be limited via the pam_limits module. This primary documentation for this can be found in:

man limits.conf

The file which this is configured in is /etc/security/limits.conf on all Red Hat type systems.

More than likely the primary thing to understand is the relationship between hard and soft limits. Additionally, some directives to start looking at are:

  • cpu
  • memlock
  • core

There are examples at the bottom of the man page.

As far as network bandwidth, this is harder to do (but not impossible). The basic idea would be to limit access based on UID via iptables and to run the traffic through tc (traffic control).

man tc
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.