[systemd-devel] Limiting resources

Daniel Poelzleithner poelzi at poelzi.org
Tue Feb 22 05:15:40 PST 2011


On 02/22/2011 11:33 AM, Cristian Patrascu wrote:

> 2. If there is such an option, is there a way to read the specified cpu
> limit from the control group hierarchy?

If you put a cpu.share value in the cpu cgroup, all processes in that
group have a weight of that value. read the cgroup docs how the share is
used.

> 4. How can I set limits in the control group specified in a .service file?
>     Ex.:
>     - in the following control group hierarchy:
> "[...]/cgroup/memory/some_subgroup/" there is a file
> "memory.limit_in_bytes" that contains the maximum memory limit of
> processes running in this subgroup. When processes reach that maximum
> amount of memory, they are killed. 

They are not killed, malloc just returns NULL and most programs don't
handle that. :-)
You can also limit the amount on ram seperatly, so a large process must
swap and will not obtain all physical ram.


kind regrads
 Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20110222/4683efa5/attachment.pgp>


More information about the systemd-devel mailing list