Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/mastodon] Use Ruby with JEMalloc for Mastodon images #77090

Open
gemelen opened this issue Feb 7, 2025 · 3 comments
Open

[bitnami/mastodon] Use Ruby with JEMalloc for Mastodon images #77090

gemelen opened this issue Feb 7, 2025 · 3 comments
Assignees
Labels
feature-request mastodon on-hold Issues or Pull Requests with this label will never be considered stale

Comments

@gemelen
Copy link

gemelen commented Feb 7, 2025

Name and Version

bitnami/mastodon 4.3.3-debian-12-r0

What is the problem this feature will solve?

Using Ruby with a default memory allocator leads to an excessive memory usage by Ruby processes, specifically by Mastodon's Sidekiq - task processing service (and to some extent by Mastodon's Puma - web service).

I went for a memory leak hunt for my installation after a regular Sidekiq outage, where instance regularly exhausted pod memory in a span of a week, leading for a service degradation and a need for manual intervention and/or "restart after X time to prevent outage" solutions.

Additionally,

  • Mastodon installation is expected to be run on Ruby with JEMalloc, see documentation
  • need to tune the memory allocator for a long-running Ruby application is an industry-known solution

What is the feature you are proposing to solve the problem?

Mastodon image creation uses pre-built Ruby component, which is built using default allocator.
It needs to be replaced with a build configured and built using that allocator library (custom or from a vendor of choice).

What alternatives have you considered?

Creating a cronjob to restart Mastodon services by schedule, which works but is error-prone by itself and needs to be added to the overall setep as a manual step, tailored to a specific environment.

@github-actions github-actions bot added the triage Triage is needed label Feb 7, 2025
@javsalgar
Copy link
Contributor

Hi,

Thank you so much for the input. So, if I understand correctly, you are proposing that we change the ruby compilation to include jemalloc. Is that correct?

@gemelen
Copy link
Author

gemelen commented Feb 10, 2025

Yes.

@javsalgar
Copy link
Contributor

Thank you so much, let me create an internal task for the team.

@javsalgar javsalgar added the on-hold Issues or Pull Requests with this label will never be considered stale label Feb 11, 2025
@github-actions github-actions bot removed the triage Triage is needed label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request mastodon on-hold Issues or Pull Requests with this label will never be considered stale
Projects
None yet
Development

No branches or pull requests

2 participants