Unicorn::Prewarm []
Prewarm your workers before they receive real traffic.
Installation
Add this line to your application's Gemfile:
gem 'unicorn-prewarm'
And then execute:
$ bundle
Or install it yourself as:
$ gem install unicorn-prewarm
Usage
In unicorn config after_fork
do:
after_fork do |server,worker|
response = Unicorn.prewarm(server)
# check if the response is OK, it shall be Net::HTTPSuccess
end
Contributing
- Fork it ( https://github.com/3scale/unicorn-prewarm/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request