Feature Request: Automatic Worker Process Recycling

Open
#262 14 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
ruby
Domain
backend

Research direction

No files, tests, or entry points are named. First clarify whether recycling should be driven by job count, lifetime, memory, or all three, then define the configuration and acceptance criteria for worker restarts and verify the behavior with targeted tests.

Written by the indexing model from the issue text.

Description

Currently, Solid Queue worker processes run indefinitely, which can lead to memory bloat and potential resource leaks over time. This is especially problematic for long-running, high-volume systems.

Feature request:
Implement an automatic worker process recycling mechanism. This could:

  1. Restart processes after a configurable number of jobs processed
  2. Restart processes after a configurable time period
  3. Restart processes when memory usage exceeds a certain threshold

This feature would help maintain a clean state, prevent memory leaks, and ensure consistent performance without manual intervention.

Potential configuration options:

SolidQueue.configure do |config|
  config.max_jobs_per_worker = 1000
  config.max_worker_lifetime = 1.hour
  config.max_worker_memory = 512.megabytes
end
Dominant language
Ruby
Stars
2.5k
Forks
250
Avg merge
7h 7m
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

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.

More from rails/solid_queue

All issues in rails/solid_queue

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.