How much swap with 1 Go RAM?

,

Hello everyone,

I have Yunohost installed on a Raspberry Pi 3B+. This machine has 1 Go RAM. The system is installed on an external SSD.

The apps are

  • Grav CMS with very low traffic
  • Nextcloud (5 sync clients, and say 1 interactive user for calendar, files and circles apps)
  • FreshRss with 2 users
  • Email

How should I configure swap. Are 2 or 4 Go enough ? I there anyway to calculate this ?

What’s the output of :
free -h

Keep in mind that creating a swap on ssd will heavily reduce its lifetime.

$ free -h
               total        used        free      shared  buff/cache   available
Mem:           909Mi       453Mi       130Mi        58Mi       325Mi       335Mi
Swap:          1.8Gi       106Mi       1.7Gi

But the server has been restarted 2hours ago

You already have 2G of swap.
May be you should set swappiness to 0 to reduce the use of swap.

1G for nextcloud and other applications may not be enough, no ?

For the swap config, create a file / etc / sysctl.d / 99-swappiness.conf with the content: vm.swappiness = 10
Personally I would put 10 and not 0.
More details: SSDOptimization - Debian Wiki

For me 2G swap looks good with 1G RAM.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.