Hi,

Do you have suggestions for kernel tweaks for getting the most out of a RAM limited system?

I am running a service requiring 2GB of RAM (netbird) on a VPS which has just 1 GB of memory. I am doing so because I am a stingy bastard and I use only free VPSs for my personal use so I get what I am paying for.

Because of this hardware limit in about 12 hours from service start I begin swapping a bit too much. This would still be manageable but soon the hypervisor gets really pissed and steals up to 90% of the CPU. So the only solution so far is restarting the docker containers every 12 hours (not great, not terrible).

Looking to improve this, Iam now experimenting with ZRAM and swappiness and it seems some benefit can be achieved by using some of the Linux kernel feaures. Is there anything else I should look into?

  • @mvirts
    link
    121 year ago

    Turn on swap! That way more of your actual ram can be used by the application. Yes, it will probably be slow as crud but it should use more memory than it has. If swap is already on… sorry

    • @aesirOP
      link
      41 year ago

      I forgot to mention, I had plenty of swap available, now I disabled swap to force zram usage. I still need to see what happens running with both, it’s hard when each trial takes 12-24 hours to show its result.

      • @mvirts
        link
        51 year ago

        Oh yikes yeah I would not be good at that pace 😅 I know you can rebuild the kernel with less features to reduce ram usage, but other than that I would be looking at what you’re already doing.

        Have you considered removing docker from the equation and running directly on the host os?

        • @aesirOP
          link
          31 year ago

          Running without docker is out of question, is a bundle of 6 docker containers. Deployment and management without it would be too complicated. Luckily somebody in another reply made me realize that the RAM eating container (cockroach DB) is far less essential than I thought and I can look for a replacement.

          • @mvirts
            link
            31 year ago

            Awesome, lol also you may be able to make a new email and free vps just to run cockroach db