9

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

1 Answer 1

9

The log you present us contains:

worker=0 spawning

The worker that will answers your HTTP requests is spawned as a separate process, with the pid 2137.

Refreshing Gem list

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.