D
D
Danil Gaisin2019-05-31 15:04:29
linux
Danil Gaisin, 2019-05-31 15:04:29

Linux isolation, where to use?

Good afternoon.
Such a situation has arisen. When developing a game server control panel , you need to limit the resources for each new game server (ram, cpu, disk).
To solve the problem, I looked towards Lxc, but the principle of operation is not very clear.
Do I need to create a new container for each game server?
Or are there other equivalents? to solve my problem?
I will be grateful for your help!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
U
uvelichitel, 2019-05-31
@uvelichitel

Isolation mechanisms in ascending order of abstraction level and, accordingly, ease of use
- an add-on over lxc designed for convenient containerization of one application, and not a full-fledged OS, unlike lxd
On FreeBSD, this is implemented by jail , bhyve mechanisms, which seem to be better, but rarely anyone can do them due to the low prevalence of FreeBSD.

S
Sanes, 2019-05-31
@Sanes

LXC is severely limited but might fit. Try to deploy the server in a container, and better in LXD (there is a rest-api there).
If there are problems, the next step I would try on OpenVZ / Virtuozzo.
And only then virtualization at the hardware level (KVM/Vmware/etc.).

M
Mysterion, 2019-05-31
@Mysterion

Enough chroot'a. It is he who is used for such tasks, if you just need to isolate processes.

B
Boris Syomov, 2019-05-31
@kotomyava

The choice of tool is correct, but if you don't really understand how LXC works, then you should either read the documentation or abandon the task, but certainly not write such a question on the toaster. =) No one can help you understand a rather complex topic with a couple of phrases in response to a question.
And so, yes - to create a separate container for each instance, of course.
In fact, there are a lot of wrappers for managing containers, but in general it’s quite enough for you to solve your LXC task, it doesn’t make much sense to go up the levels and use more complex wrappers over the same mechanisms.
In general, you need to read about what you will manage, namely namespaces and cgroups first of all. Perhaps this will put everything in its place for you ...

P
pfg21, 2019-05-31
@pfg21

try playing around with systemd unit limits.
limitation on the use of the processor, memory and disks it has built-in.
there are a couple of old articles in the memos 0pointer.de/blog/projects/resources.html vladimir-stupin.blogspot.com/2013/03/systemd-3.html
well man https://www.freedesktop.org/software/systemd /man/s...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question