I see the following statement while starting a rails app using unicorn, what does it do and how to avoid this:
I, [2013-03-28T06:46:05.060194 #1762] INFO -- : worker=0 spawning...
I, [2013-03-28T06:46:05.066834 #2137] INFO -- : worker=0 spawned pid=2137
I, [2013-03-28T06:46:05.067210 #2137] INFO -- : Refreshing Gem list
The log you present us contains:
The worker that will answers your HTTP requests is spawned as a separate process, with the pid 2137.
According to the official Unicorn documentation (http://unicorn.bogomips.org/SIGNALS.html), the Gem set is reloaded in order so "updated code for your application can pick up newly installed RubyGems"
Looking at the source code, the message "Refreshing Gem list" is called whenever the application is built:
def build_app!
if app.respond_to?(:arity) && app.arity == 0
if defined?(Gem) && Gem.respond_to?(:refresh)
logger.info "Refreshing Gem list"
Gem.refresh
end
self.app = app.call
end
end
end
Setting the preload_app
config provides some control over this behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With