Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Lennart Poettering
On Mon, 26.03.12 10:07, Manuel Amador ([email protected]) wrote: > Memory limit and memory soft limit aren't rlimits, but cgroup limits? Yes. > Is this documented somewhere? Yes. See systemd.exec(5): "This controls the memory.limit_in_bytes and memory.soft_limit_in_bytes control group attribut

Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Mirco Tischler
Am 26. März 2012 16:46 schrieb Lennart Poettering : > On Mon, 26.03.12 11:06, Albert Strasheim ([email protected]) wrote: > > See http://www.kernel.org/doc/Documentation/cgroups/memory.txt for more > information how MemoryLimit= and MemorySoftLimit= work. > >> Is there a way for an application to d

Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Manuel Amador
Memory limit and memory soft limit aren't rlimits, but cgroup limits? Is this documented somewhere? Sorry if I spread any misinfo. On Monday, March 26, 2012 16:47:24 Lennart Poettering wrote: > On Mon, 26.03.12 02:44, Manuel Amador ([email protected]) wrote: > > memorylimit and memorysoftlimit c

Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Albert Strasheim
On Mon, Mar 26, 2012 at 4:46 PM, Lennart Poettering wrote: >> Also, is there some standard way for the app[M#O7lication to determine if a >> MemoryLimit= is configured? We might want to automatically size some >> buffers based on this limit. > You can read /proc/self/cgroup. Find the line with ":m

Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Lennart Poettering
On Mon, 26.03.12 02:44, Manuel Amador ([email protected]) wrote: > > memorylimit and memorysoftlimit can be determined using the ulimit system > call. AFAICS that is simply not correct. The resource limit logic and the cgroup memory logic are orthogonal. Lennart -- Lennart Poettering - Red H

Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Lennart Poettering
On Mon, 26.03.12 11:06, Albert Strasheim ([email protected]) wrote: > Hello all > > We want to limit the memory a service can use using MemoryLimit= and > MemorySoftLimit= described in systemd.exec. > > As I understand it, LimitAS= and LimitRSS= aren't particularly useful. > Linux doesn't even i

Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Manuel Amador
Yes, getrlimit. yes, rlimit_as On Monday, March 26, 2012 11:50:11 Albert Strasheim wrote: > Hello > > On Mon, Mar 26, 2012 at 11:44 AM, Manuel Amador wrote: > > memorylimit and memorysoftlimit can be determined using the ulimit system > > call. > > Do you mean getrlimit? man 2 ulimit on F16 s

Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Albert Strasheim
Hello On Mon, Mar 26, 2012 at 11:44 AM, Manuel Amador wrote: > memorylimit and memorysoftlimit can be determined using the ulimit system > call. Do you mean getrlimit? man 2 ulimit on F16 says it's not implemented. If it's getrlimit, is it RLIMIT_AS? > you cannot detect when you've hit the soft

Re: [systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Manuel Amador
memorylimit and memorysoftlimit can be determined using the ulimit system call. you cannot detect when you've hit the soft limit other than by getting a NULL on malloc. On Monday, March 26, 2012 11:06:42 Albert Strasheim wrote: > Hello all > > We want to limit the memory a service can use usin

[systemd-devel] MemoryLimit and MemorySoftLimit

2012-03-26 Thread Albert Strasheim
Hello all We want to limit the memory a service can use using MemoryLimit= and MemorySoftLimit= described in systemd.exec. As I understand it, LimitAS= and LimitRSS= aren't particularly useful. Linux doesn't even implement LimitRSS? http://unix.stackexchange.com/questions/32368/how-to-limit-appl