On Tue, 22 Jan 2013 21:44:03 -0700, Christopher Samuel <[email protected]> 
wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 23/01/13 04:13, Mark A. Grondona wrote:
> 
> > If you want to limit allocations rather than resident memory, you 
> > can disable overcommit (i.e. set /proc/sys/vm/overcommit_memory to
> > 2),
> 
> We already do that to avoid having nodes hang due to the annoying OOM
> killer lockups you can get.   Haven't had a deadlock like that for
> years now.
> 
> > but afaik in RHEL6 you have to do this for the system as a whole.
> 
> Yeah, that's a sysctl for the kernel, we run with:
> 
> # Stop nodes OOM'ing
> vm.overcommit_memory = 2
> vm.overcommit_ratio = 93
> 
> > Disabling overcommit will make calls to malloc() fail immediately 
> > if too much memory is already ~committed~ to other processes, so
> > you may end up having a lot less RAM than you expect depending on
> > the behavior of other processes on the system. If your nodes run a
> > single job then this is less of a problem.
> 
> What we want (and what we get as a per process limit with Torque with
> our RLIMIT_AS patch) is if a user requests a job with 1GB of RAM then
> any attempt by a program to malloc() more than that should cause
> malloc() to fail.

Yes, but unfortunately it appears that system overcommit setting
does not affect the functionality of the memory cgroups implementation,
which *only* limits resident memory. So you can think of the
current memory cgroup implementation as affecting rss only.
This is what most people are interested in because on systems
these days you have mostly limitless adress space.
 
> I'm pretty sure that's meant to be possible via cgroups.

It looks like back in 2008[1] there was an attempt to create a
"memrlimit" cgroup controller that did what you want, but
for whatever reason it was apparently never merged into the
kernel. So far the developers have expressly sought to *only*
limit rss with a cgroup controller, afaics.

mark

[1]  http://lwn.net/Articles/283287/

 
> cheers,
> Chris
> - -- 
>  Christopher Samuel        Senior Systems Administrator
>  VLSCI - Victorian Life Sciences Computation Initiative
>  Email: [email protected] Phone: +61 (0)3 903 55545
>  http://www.vlsci.org.au/      http://twitter.com/vlsci
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> 
> iEYEARECAAYFAlD/XtIACgkQO2KABBYQAh9DjgCePdsAwg42Z8ZFyULgNze7UF9+
> sxgAn2ChTTtmQcvPOEkdv/8yy2x+QWEl
> =gksu
> -----END PGP SIGNATURE-----
> 

Reply via email to