-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Move unicorn_killer to Gemfile #6792
Conversation
require ::File.expand_path("../lib/rack/internet_explorer_version", __FILE__) | ||
|
||
# Kill unicorn workers really aggressively (at 300mb) | ||
if defined?(Unicorn) | ||
use UnicornKiller::Oom, 300 * 1024 | ||
require 'unicorn/worker_killer' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
require ::File.expand_path("../lib/rack/internet_explorer_version", __FILE__) | ||
|
||
# Kill unicorn workers really aggressively (at 300mb) | ||
if defined?(Unicorn) | ||
use UnicornKiller::Oom, 300 * 1024 | ||
require "unicorn/worker_killer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This require
should be on top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily, since the defined?(Unicorn)
makes unicorn optional with no changes besides the Gemfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was more worried about codestyle here - requires in the middle of the code look weird. But if you're fine with it, I can get over it. ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not too weird and I mean there's another require just above it still
Move unicorn_killer to Gemfile
Merged.
If we do, we can always add that later. :) |
I stumbled over that and though it is a good idea to use the gem file instead. There are a view changes since 2013.
There is also the possibility to kill workers by max_requests:
Do we need/want this? If so.. unfortunately I have no reference for some max/min values:
I found some examples with 500-600 request per worker.
related to #6269