mastodon / mastodon/mastodon

Memory hog since v4.7.0 - server fills up RAM with sidekiq threads

Open
#40,407 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
50.3k
Forks
7.5k
Avg merge
12h 54m
Merged PRs (30d)
247

Description

Steps to reproduce the problem
  1. Deploy Mastodon v4.7.x
  2. Monitor RAM usage
  3. It fills up gradually over the days
Expected behaviour

Memory RAM usage should remain within nominal boundaries

Actual behaviour

RAM fills up over the days and does not seem to be released.

Detailed description

RAM consumption seems to stem from a great number of sidekiq threads (> 3,000 after one day, despite -c 30 in systemd sidekiq service).

It will grow by 20% within three to four days on a 32 GB RAM server (with over half of it free on starting Mastodon).

A restart of Mastodon processes resets memory usage (RAM is freed), and then it starts over again, consistently.

This did not happen on versions prior to v4.7 branch.

Mastodon instance

gayfr.social

Mastodon version

v4.7.1 (started on v4.7.0)

Technical details
  • Ruby version: 4.0.6
  • Node.js version: 24.20.0
  • Native install (no docker) on Ubuntu 24.04LTS

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the gradual RAM and Sidekiq-thread growth on Mastodon v4.7.1 using the native Ubuntu systemd setup described in the report, while monitoring process and thread counts over several days. Compare behavior with a pre-v4.7 version if available; done means identifying the regression and confirming that memory and thread usage remain within expected bounds after the fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, devops, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.