Subject: Can vservers' RSS limits be decreased dynamically?
From: Matei Zaharia <matei@matei.ca>
Date: Thu, 29 Oct 2009 19:24:54 -0700

Hi,

I've tried to use vlimit to change a vserver guest's resident set size  
(RSS) limit at runtime, as described at http://linux-vserver.org/Memory_Limits 
. I noticed that if the guest's RSS is above my limit when I run  
vlimit, then it is allowed to stay above this limit until its  
processes finish. For example, if one of my guests is running a  
process with a 50 MB RSS, and I set the limit to 20 MB, the process  
continues to run, and vserver-stat and vtop show its RSS staying at  
50. However, if I kill this process and try launching a new one with  
the same RSS in the guest VM, the new process is killed. It appears  
that the limit is set properly but is not applied to existing  
processes. Is there any way to force the existing process to be killed  
when the RSS limit is lowered?

The same issue happens if I set the address space (AS) limit instead  
of the RSS limit. It also happens if I write my limits to /etc/vserver/ 
<whatever>/rlimits/rss before running the vlimit command.

I'm running the Ubuntu Jaunty version of vserver from http://linux-vserver.org/Installation_on_Ubuntu

. Vserver-info says it's the following version:

                    Kernel: 2.6.28-16-vserver
                    VS-API: ???
              util-vserver: 0.30.216-pre2772; Jan 12 2009, 12:13:20


Thanks,

Matei Zaharia