OpenVZ Forum


Home » General » Support » Swap with non-VSwap kernel (cannot make swap working in OpenVZ containers)
Swap with non-VSwap kernel [message #44715] Fri, 23 December 2011 23:28 Go to next message
Artem is currently offline  Artem
Messages: 9
Registered: December 2011
Location: Belarus, Minsk
Junior Member
Hi,

OpenVZ is great, it saves me much time maintaining a bunch of similar VMs. Migration from VirtualBox to OpenVZ seems to be a great idea, and I now have 7 VMs instead of 4 on the same hardware!

Recently got that enabling swap on containers can increase performance (it's application-specific). After changing swappages to a value for 4GB, I was able to see 4GB swap inside a container. But it remains 100% free all the time, even when container runs out of memory.

Unfortunately I'm stuck to 2.6.18 kernel and CentOS 5.7. Is there any way to force containers to make use of swap?

Thanks!

-Artem

HN Hardware: 16 GB RAM, Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz
HN OS: CentOS 5.7 (Final)
Kernel: Linux 2.6.18-274.3.1.el5.028stab094.3ent (it's not yet VSwap, right?)

# rpm -qa | grep vz
vzctl-3.0.29.3-1
vzkernel-firmware-2.6.32-042stab036.6
vzquota-3.0.12-1
vzctl-lib-3.0.29.3-1
ovzkernel-ent-2.6.18-274.3.1.el5.028stab094.3
Re: Swap with non-VSwap kernel [message #44764 is a reply to message #44715] Fri, 30 December 2011 16:43 Go to previous messageGo to next message
azagzin is currently offline  azagzin
Messages: 38
Registered: May 2008
Location: Vilnius
Member
Hi,

from VSwap wiki page http://wiki.openvz.org/Vswap
Quote:

New RHEL6-based OpenVZ kernel has a new memory management model, which supersedes User beancounters. It is called VSwap.


Happy New Year !!! Smile
Re: Swap with non-VSwap kernel [message #44765 is a reply to message #44764] Fri, 30 December 2011 16:52 Go to previous messageGo to next message
Artem is currently offline  Artem
Messages: 9
Registered: December 2011
Location: Belarus, Minsk
Junior Member
Thanks, I see, but it does not clarify if/why I can(not) use swap in EL5. Actually 'RHEL6' looks confusing for me as a CentOS user.

Happy New Year!
Re: Swap with non-VSwap kernel [message #44772 is a reply to message #44715] Sat, 31 December 2011 14:02 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
Er... you cannot use VSwap with RHEL/CentOS/Scientifc Linux/etc. 5 openvz kernels because they don't support it. I think that much is obvious... Cool

Sorry. I know it looks like a nice thing to have... Very Happy

OK, joking aside. You might be able to run a RHEL 6 kernel on a RHEL 5 system (or CentOS or whatever), without upgrading the node OS. I'd do some testing before trying this on a production server, though.

Happy New Year
Re: Swap with non-VSwap kernel [message #44774 is a reply to message #44772] Sat, 31 December 2011 14:24 Go to previous messageGo to next message
Artem is currently offline  Artem
Messages: 9
Registered: December 2011
Location: Belarus, Minsk
Junior Member
Hi,

Thanks, I just didn't get the line between 'vswap' and 'swap'. I thought of VSwap just as a new model of memory configuration, not the thing which brings the ability to use swap in containers.

Will try to upgrade the kernel when I have a chance. For now I can only use 2.6.18, gah!

thanks for the clarification. All my questions seem answered now.
Re: Swap with non-VSwap kernel [message #45304 is a reply to message #44715] Thu, 23 February 2012 16:06 Go to previous messageGo to next message
seanfulton is currently offline  seanfulton
Messages: 105
Registered: May 2007
Senior Member
IN RHEL5, you define a block of memory and OpenVZ takes care of what gets swapped and what does not. There are a lot of tuning options you can apply to determine how things get swapped, but the end result is--in my opinion--not a lot of control over how RAM/SWAP is allocated on a per-VE basis.

On a 16G machine wiht 16G swap, you wind up having to allocated 32G of RAM, and let Openvz manage it.

With the new vswap kernel, you can divvy up ram yourself.

sean
Re: Swap with non-VSwap kernel [message #45306 is a reply to message #45304] Thu, 23 February 2012 16:43 Go to previous message
Artem is currently offline  Artem
Messages: 9
Registered: December 2011
Location: Belarus, Minsk
Junior Member
oh. This is great. Thank you for this description sean!
Previous Topic: Heartbeat+openvz
Next Topic: SSH, putty closes
Goto Forum:
  


Current Time: Mon Jul 15 04:21:57 GMT 2024

Total time taken to generate the page: 0.02330 seconds