S
S
Sanes2016-07-31 17:58:20
OpenVZ
Sanes, 2016-07-31 17:58:20

How reasonable is it to keep OpenVZ containers on the same OS template?

I heard several times that if you keep containers on the same OS template, you can win a lot in memory. Does anyone have practical experience?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
landergate, 2016-07-31
@Sanes

The more RAM consumed by the same processes (including system ones) between containers and the more such containers, the higher the density will be.
If we talk about pure OpenVZ, without Virtuozzo, then the technology is called KSM (Kernel samepage merging). Access in the kernel since version 2.6.32. Disabled by default.
It can be used not only for OpenVZ.
You can enable it on the hypervisor through:
View efficiency:
Documentation in the context of OpenVZ:
https://wiki.openvz.org/KSM_(kernel_same-page_merging)

P
Puma Thailand, 2016-07-31
@opium

Well, for less than a hundred containers, it seems to me that there’s really no point in bothering, and even then if you allocate a container with very little RAM, and if there is a lot of special meaning and not much for a hundred containers, the gain will be small percentages.

L
Lindon_cano, 2016-07-31
@Lindon_cano

Using OpenVZ, in principle, does not make sense.
A division of a commercial office that does not know how to work with memory. What for it, in the presence of normal containers (lxc)?

S
Sergey Bronnikov, 2016-07-31
@estet

In general, this only makes sense if you want to have a high density of containers on a large fleet of servers. Because on one server the game is unlikely to be worth the candle.
One solution to the problem of memory consumption when working with containers can be solved using memory deduplication, which is spent on storing binary files. Its essence is this: when creating a new container, calculate the hash sum of each binary file in this container, when opening a Linux binary file, the kernel checks against the table of calculated hash sums, and if the same hash sum is present in the table, then the already opened file is used , but not another copy of it opens. This is if you explain on your fingers :)
The technology is called pfcache and was added to Virtuozzo 6. It is not available in OpenVZ 7.
If you are interested in more details, you can see the slides from LinuxCon www.slideshare.net/openvz/pfcache-linuxcon-2015.
A well-known friend from a hosting company tried to replicate this technology on OpenVZ and wrote about his results in the blog https://www.stableit.ru/2015/05/openvz-pfcache.html Perhaps this option will suit you if there is no money for Virtuozzo.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question