[systemd-devel] how to let systemd hibernate start/stop the swap area?
Michael Chapman
mike at very.puzzling.org
Fri Mar 31 10:54:51 UTC 2023
On Fri, 31 Mar 2023, Lennart Poettering wrote:
> On Fr, 31.03.23 18:24, Michael Chapman (mike at very.puzzling.org) wrote:
>
> > On Fri, 31 Mar 2023, Barry wrote:
> > [...]
> > > If you want to run in ram only then you must turn off the kernel overcommit.
> > > Have you done that? If not then you risk processes getting SEGV signals.
> >
> > Seriously. It's almost as if nobody here is actually reading anything of
> > what I've written!
> >
> > EVERYTHING fits in RAM. The non-guest processes total perhaps a GB in
> > total. The guest processes total maybe 200 GB in total. The server has
> > more RAM than all of that.
>
> I presume you are also running the OS itself from RAM then? i.e. your
> rootfs is not backed by disk, but by some in-memory fs, or a loopback
> on a memfd or so?
>
> because otherwise you just remove the latencies from anonymous memory
> but you amplify the latencies on file-backed memory. Which is overall
> worse, not better.
The host isn't doing much IO. Just a bit of logging really. How would the
existence of swap effect that? Is it really so much better to be able to
log messages just that little bit faster, but you've now got to wait for
`sshd` to swap back in whenever you SSH to the system?
> > I know this works because I have literally done it on many, many
> > hypervisors for over a decade.
>
> I mean, you have a point: if you run on idle machines where hardware
> is so massively oversized for the job you are doing, you can operate
> really nicely without swap. No doubt. But that's kinda
> wasteful. Resource-management through oversized hw is certainly a way to
> solve problems, no doubt.
The alternative would be to _overprovision_ the server -- i.e. put more
VMs on it than it can support. That would just be stupid.
Sticking with the example above, if the guests' RAM total 200 GB are you
really suggesting that only having, say, a 204 GB server and making up for
the lack of memory by adding swap would actually be better? Of course it
wouldn't!
The VMs certainly weren't idle. Some of them had a fair bit of idle RAM,
yes, but that's not entirely unusual. Plus, I don't get to choose what the
VMs run, my customers do.
More information about the systemd-devel
mailing list