Skip to content

Commit

Permalink
added additional information
Browse files Browse the repository at this point in the history
  • Loading branch information
smellman committed Jul 9, 2024
1 parent f5c62c8 commit c0e73df
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,50 @@ GoodJob::Engine.middleware.use(Rack::Auth::Basic) do |username, password|
end
```
5. Restart your Redmine instance

## Another configuration

### database.yml example:
```yaml
pool: <%= ENV.fetch("RAILS_MAX_THREADS", 5).to_i + ENV.fetch("GOOD_JOB_MAX_THREADS", 2).to_i %>
```
### puma.rb example:
```ruby
# Set the number of Puma workers from an environment variable, defaulting to 3 if not set
workers ENV.fetch("PUMA_WORKERS", 3).to_i

before_fork do
require 'puma_worker_killer'

PumaWorkerKiller.config do |config|
config.ram = ENV.fetch('RAILS_MEMORY_LIMIT', 2048).to_i
config.frequency = 10
config.percent_usage = 0.8
config.rolling_restart_frequency = false
config.reaper_status_logs = false
end

PumaWorkerKiller.start

# Ensure GoodJob shuts down before forking
GoodJob.shutdown
end

on_worker_boot do
# Ensure GoodJob restarts after the worker boots
GoodJob.restart
end

on_worker_shutdown do
# Ensure GoodJob shuts down cleanly when a worker shuts down
GoodJob.shutdown
end

MAIN_PID = Process.pid
at_exit do
# Ensure GoodJob shuts down when the main process exits
GoodJob.shutdown if Process.pid == MAIN_PID
end
```

0 comments on commit c0e73df

Please sign in to comment.