The VPS#
A few years ago I bought the cheapest VPS from buyvm.net for $20/year. The VPS only had 512MB of memory and 1 vCPU. Since then the price went up to $24/year, And even though it isn’t reflected on the buyvm website my renewal next month is being billed at $30/year.
Nevertheless, It was a cheap VPS, but very low resource capacity.
The Goal#
I have a lot of infrastructure in my homelab (some may call it home-prod at this point). I only expose things that 100% need to be exposed in order to adhere to PoLP.
I previously had a Pangolin instance on the Oracle free tier, however without notice the VM was gone. Being surprised by the VM being gone without any notification and having ran production workloads in Oracle Cloud for years and not being pleased with their product I decided I was going to re-host something like Pangolin on the VPS that I already had.
At the time of writing this article Pangolin lists in their docs that the recommend specs for a VPS is 2vCPU, 2GB of memory and 20GB storage. My VPS was smaller on all 3 accounts. So I decided to use something slimmer.
NixOS#
I’ve recently been a convert to the Nix way of life. Using NixOS on various devices has been wonderful and I decided this new setup would be a great candidate for NixOS. Those who know Nix might already see a problem with this setup (foreshadowing!).
Caddy and Wireguard#
All I really needed for my use-case was a reverse proxy and a way to route traffic into my homelab. Caddy and Wireguard both fit the bill.
Caddy#
Here is a snapshot of how many resources Caddy instance uses while being used for one domain.
%CPU %MEM RSS
0.0 4.7 22276
Basically zero CPU (even when converting to millicores I got 0m), and about 23 MB of memory.
Wireguard#
I’m using the Wireguard Linux kernel module so we can’t find the usage with ps, but even user-space implementations use less than 10MB in mem and almost no cpu.
NixOS Builds#
Under normal operation 512MB of memory and 1 vCPU was plenty, even when extra resources, the culprit that caused issues was during NixOS builds. Look at the resources when a build was happening.

All of the memory and almost all of the 1GB of swap memory was used up during a build. The CPU was also at 100%.
During the build and switch the one endpoint I had setup with Caddy would have high latency, even when I tuned Caddy to all stay in memory and not go into swap. I never had any failures but I saw almost 2s of latency at one point.

I was using comin to do a pull based deploy. The downside is that
the build was done on on the VPS. If I used a push based deploy it could help but I just never got
around to it. I also like the pull based approach since I don’t have to setup much automation
around deployments. It aligns with a Gitops workflow where I push a change to testing-<hostname>
and comin does a nix test, then when I merge to main comin does a nix switch.
Extra resources#
I did have a few more resources running on the NixOS VPS, including Crowdsec, which used the most resources.
Crowdsec:
%CPU %MEM RSS
1.1 10.5 49716
Prometheus
%CPU %MEM RSS
0.6 2.2 10640
Prometheus node exporter
%CPU %MEM RSS
0.2 2.7 13160
systemd upload
%CPU %MEM RSS
0.0 0.6 3204
If we tally up all of these including caddy the total was about 99 MB, which doesn’t include the small overheard for Wireguard and the rest of the system. When no rebuilding my memory usage would mostly be under 512MB and always under the 1.5MB if you include swap. Of the 99 MB, Crowdsec is 50MB.
Conclusion#
So all in all you can run something similar to Pangolin if you only need to route http traffic from outside your network into a network. My homelab still doesn’t have any open ports since the wireguard endpoint inside my homelab connects to the VPS1 to create the tunnel.
What would you have done differently? Send me an email, I’d love to hear it.
