Have a freshly migrated Discourse instance on a new server.
Getting the error in logs: PG::DiskFull (ERROR: could not resize shared memory segment "/PostgreSQL.1759815625" to 8388608 bytes: No space left on device )
It’s strange because, the previous server (64gb ram) didn’t have this issue and I had these set:
db_shared_buffers: "25632MB"
db_work_mem: "160MB"
On the new server (128gb ram), I can’t increase above the baseline defaults (I tried tripling the values below and get the same PG DiskFull error):
db_shared_buffers: "128MB"
db_work_mem: "40MB"
Previous machine has docker 27.x on it (auto installed via the discourse installer). New machine installed docker.io as per instructions (so 26.x). I tried switching to docker 27.x to see if that was related - but it didn’t change anything. Both are on the Stable Discourse branch, version 3.3.2.
It seems shm_size might be the main culprit:
Though no idea why it wasn’t an issue on the previous server and it is on the new server. The only other main difference is the old server uses Ubuntu 22.04 LTS and the new server is on 24.04 LTS.
I tried this also, but the changes get overwritten when the container is started again
shm_size appears to be hardcoded into the launcher:
So to follow up in case someone else faces this issue - the above solved this for me. I do not need to edit shm-size in the launcher anymore.
This was found after noticing this warning during rebuild: WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.