Pleroma has gotten bloated
First some context:
Not long after I started my server, I had a conversation with someone about the memory usage of Pleroma[1]
From that conversation I get that on 18th of September my instance "uses almost nothing (like 4% and then 2-4% for postgress)"[2] on a 1G RAM SBC. Another person in the conversation had a better screenshot of their usage[3] (having 0.6GB RAM total on the server), which was about 60MB.
By now I'm running on a 512MB SBC because I had problems with the 1G board, but even that went fine for a while. A while ago (i dunno, could be months) I started to see my instance crash at times. I added 250MB SWAP and noticed that my server didn't crash any more (I could get an error "error fetching updates", but that never lasted long).
I've decided to check it out now. Running top, I see a whole bunch of Postgresql threads each taking up a shitton of memory[4]. I'm a bit confused as to how to read this, because I've got ten threads each running 20% which seems impossible :/ But still, a whole lot more memory usage then the 60MB it was in September.
From this follows:
If we want Pleroma to be a cheap easy-to-setup-and-run fedi-server (and I believe we want that), then having an acceptable memory usage is a must. In the conversation lain pointed out that "Usually you don't need to change anything to get Pleroma + Postgres running in around 200~ mb ram, which is sort of what to expect". I think we should see if we can bring it back to those levels.
I also think having good default settings for single-user-instances on low-end hardware makes sense for Pleroma because I think we can expect that people who want to set up big instances are (or at least typically should be) generally more confident with going through config and changing setting.
Note: I've changed to pool_size: 3
now, which may help me in the short run, but this doesn't change the fact that Pleroma has gotten bloated and that people who set it up will need to do more to get memory usage under control, which complicates setup and maintenance.
[1] https://mastodon.pirateparty.be/@Ilja/100758968595813758