I am setting up a balena test enviroment where I am connecting a few devices, and I noticed vpn and api services are taking quite a lot of ram.
Especially the vpn docker ram footprint seems to increase over time…
This is the amount of memory it takes after 27h uptime:
I was looking at a VPN machine in a staging environment as an (arguable) basis for comparison, and (coincidentally?) the VPN container was taking around 350MB RAM which is not too different from the 387MB you’ve shared in the screenshot. The VPN container I looked at was “up” for 6 days. I wonder if it could be a case of some memory caches in the VPN implementation that grow up to a certain limit, then starts discarding older entries so stops growing. If you keep it running for longer, like 2 or 3 days, it just might stabilise.
While the VPN service is quite memory hungry, I’m not aware of any memory leaks in the stack currently. In production we do observe a relatively fast growth of memory usage after a deploy but that flattens out and doesn’t appear to continue to grow.
I will setup an open instance here and leave it running for a few days, ideally with some automated traffic, and see if I can track down any memories issues. I’ll get back to you if I discover anything relevant.