[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-relays] Re: Tor guard relay memory: what actually reduces RSS on Ubuntu 24.04



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hello.

Tor at 1AEO wrote:
> Unfortunate about the mimalloc 2.x segfaults on Alpine Linux with Tor.
> Looking forward to your results with jemalloc, which also worked well
> for us.

I'm hesitant to switch to jemalloc on too many systems due to the poor
security track record it has, although a random segfault with mimalloc
does not give me the warm fuzzies, either. That is why I suggested to
give mozjemalloc a try. It should be a drop-in replacement.

> We haven’t researched root causes, allocator parameters, build-time
> changes, or mozjemalloc yet. It would be great to see more relay
> operators sharing more experiments and data points.

There are a number of other memory allocators out there that you may
want to test along with various tweaks. I would be interested to see how
Daniel Micay's hardened_malloc runs on relays. I believe it is based on
OpenBSD's omalloc and the Android Bionic libc's malloc. While it is a
security-focused allocator, it actually *reduces* metadata overhead and
fragmentation. Depending on the configuration, it may require a LOT of
VMAs, thus increasing non-swappable slab pressure.

> The memory savings have been substantial: roughly 200 relays now
> consume ~300 GB total instead of ~1000 GB, which is a significant
> operational cost difference.

Most of my relays have 1-2 GB RAM, which seems to be the minimum that
does not cause performance loss under memory pressure and can sustain
100 Mbps in each direction. In my case, the worst situation seems to be
when so much non-swappable kernel memory is used (from the connection
tracking table, socket structures, etc.) that a GFP_ATOMIC allocation
fails, which locks the whole system up. Sadly, this happens even when
there is plenty of swap remaining and while raising vm.min_free_kbytes
helps somewhat, it's not a panacea.

I suspect reduced userspace memory fragmentation would not help all that
much in my particular instance, but I'm sure it's very useful on systems
that have multiple relays running on them.

Regards,
forest
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQtr8ZXhq/o01Qf/pow+TRLM+X4xgUCaWNcqQAKCRAw+TRLM+X4
xsnyAQDKrQvG7Gj6gJ9ODw+GwyXELo3f3zK8ROzUx+6NCvvK5QD+Lsr2SbQxc5OE
zCAlZkUcJ3GO3XgnIXNuRrn3M6myeQI=
=ZrqW
-----END PGP SIGNATURE-----
_______________________________________________
tor-relays mailing list -- tor-relays@xxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to tor-relays-leave@xxxxxxxxxxxxxxxxxxxx