Sharing my #Terraform setup for self-hosting #Mastodon: https://github.com/tjpalanca/tjcloud/tree/master/modules/mastodon

It's deployed as 3 images (web, streaming, and sidekiq) on #kubernetes based off of the official docker image, and the databases are run in the database module.

A few tweaks 🔧 I made to reduce memory usage of my #SelfHostedMastodon instance (note that I am the only user).

With the default settings, the combined memory usage is 1.4 GB.

* reduced number of sidekiq workers to 2 instead of the default 5 (-300MB RAM usage)
* reduced the puma workers (`WEB_CONCURRENCY`) to just 1 with 4 max threads (`MAX_THREADS`), from 2 processes with 5 max threads each (-300MB)
* reduced `STREAMING_CLUSTER_NUM` to just 2 from the default (cores - 1) (-40MB)

Now 800MB

@tjpalanca How heavy is that? I've been considering starting a personal one or perhaps one of the forks if i end up sticking to the #fediverse long term. #hosting

@BlueGreenZeros

Admittedly quite memory-heavy even if I am the only user. I haven't yet tuned it to default settings - I can think of reducing the number of sidekiq processes/threads as a start.

@tjpalanca Thanks! doesn't look bad at all, may be able to run it off of a small raspberry pi server i already have if i get an actual SSD for it! running postgres on a SD card doesn't sound like a good idea 😅

@BlueGreenZeros Haha yes, it is quite I/O heavy on media as well. My instance has only been around for 2 days and its cached 8GB, it does delete them after 7 days (configurable) though.

If you ever get around to it would love to see the setup :)