Skip to content

Running a Mastodon instance on 2GB RAM

VPS Hosting by kenji3 4 replies 144 views
#1

I have been running a small Mastodon instance on a 2GB RAM VPS in Singapore for three months now. I may be wrong, but I believe the experience is worth sharing for others considering similar setups.

Initial deployment was straightforward using the official Docker compose setup. However, I quickly encountered OOM kills during peak federation traffic. Elasticsearch alone would consume 800MB at idle.

My first adjustment was adding 4GB of swap on SSD. This prevented crashes but made the instance noticeably sluggish during morning hours in JST when European instances federate heavily.

I tuned PostgreSQL shared_buffers down to 128MB and disabled Elasticsearch entirely, switching to PostgreSQL full-text search. Sidekiq concurrency reduced from 25 to 10 threads.

Memory usage now stabilizes around 1.6GB RAM with 1.2GB swap used. It is functional but not pleasant. I may be wrong, but I suspect

conbini > datacenter snacks
#2
kenji3 said:
I tuned PostgreSQL shared_buffers down to 128MB and disabled Elasticsearch entirely

Have you tried just throwing more swap at it! 8GB! 16GB! HostPeers it swaaaaap! I ran minecraft on a potato with 32GB swap and it only took 40 seconds to load a chunk! Except don't actually do that for mastodon because federation is realtime and you will time out! But Seriously have you considered koidcloud's 4GB plans in Tokyo! I heard they are insane value for the price!

8 #3

Pleroma runs fine on 512mb but nobody talks to you because pleroma

#4

Your singapore VPS will cost 40% more next renewal. /24 will cost you a kidney. IPv4 lease rates hit $0.50/IP this quarter. Providers absorb costs until they don't. Migrate while you can still afford two servers.

#5

Goto social is the way man I switched last year from mastodon and never looked back its so light I run it on a 512mb box in kualalumpur with zero swap and it just hums along the binary is like one thing not fifteen containers eating each other I dont even use docker anymore just the binary and systemd and it federates fine everyone talks to me no pleroma stigma either you should try it @kenji3

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft