I would like to tweak some settings on my server to better use the resources I have.

The Linux server in question has 32gb RAM, running general Docker containers of the selfhosted variety, no AI, and 250gb SSD. Currently, the server has no swap with swappines set at 60.

Swap:              0           0  
vm.swappiness = 60

Generally, only one app is being engaged at a time and everything seems to respond fairly well.

So, my question is, what would be a good swapsize and swappiness level for this server? I realize that all of this is dependent on how the server is used and load level during operation. Is there a rule of thumb to go by. I’m sure there will be some tweaking involved, but I was looking for a good point to deviate from. Where do you guys set swap and swappiness?

Thanks

  • just_another_person@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 days ago

    It really depends on how your memory gets allocated when everything is at peak utilization. If you have a process that needs 4GB that you don’t want to fall over when memory runs out, then you need that +~10%-ish. If everything you’re running is critical, then you want at least the size of your memory allocated for swap.