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
fork_worker automatic refork never triggers #2985
Comments
I think more data might be helpful. I set fork_worker to 1000, and threw a wrk stream at a server, and it did restart, so I'm not sure what the issue is (yet). That was using master, not a release.
You might check that, I think the number should be more like a refork once every 43 minutes? 40k/(8*24) = 208 req per hour per worker... |
Oh yeah, worth mentioning this is on puma 5.6.4 — though I don't see anything in the 5.6.5 release notes that I think would change this? I'll go test that + master with my application to see if it does. |
Most of my local test code is for master; I probably should have checked 5.6.5 or 5.6.4. I'll check a release sometime soon... |
I was looking into this more today and checked my |
Interesting. I'll see if I can repo. |
@slondr still having this issue? are you able to reproduce it for us if so? |
This will enable automatic fork # Auto-fork after the specified number of requests.
if (fork_requests = @options[:fork_worker].to_i) > 0
@events.register(:ping!) do |w|
fork_worker! if w.index == 0 &&
w.last_status[:requests_count] >= fork_requests * (w.phase + 1)
end
end |
Auto-fork after the specified number of requests always. Commit |
Describe the bug
I have
fork_worker
enabled and was excited to deprecate my hand-spun automatic cluster restart with the built-in automatic refork functionality. However, after a couple months of usingfork_worker
live on production, I have never seen a refork actually occur without manual intervention. On a typical day, my application gets about 40,000 hits, and I have puma configured for a cluster size of 8 workers. I've tried setting the value of thefork_worker
to as low as 150, which should mean a median of (40k requests divided by 8 workers divided by 1/150 for a time series of reforks per time quanta...) 21 reforks per minute! Yet, I never see the telltale drop in memory usage that I see when I manually send SIGURG to the cluster, never see any of the typical worker startup messages in the logs, etc.Puma config:
I launch puma via systemd, with the command
RAILS_ENV=production bundle exec --keep-file-descriptors puma
.The text was updated successfully, but these errors were encountered: