Serg Podtynnyi <[email protected]> wrote:
> I am asking about this default values because by the convention
> production env is 99% "production", but in the code I see
> "deployment", so most of the people that are using unicorn have bogus
> logs on production. Thanks for clogger suggestion.

Yeah, as I explained in the other post, I've always tried to base as
many defaults off Rack defaults so people have less trouble switching
from/to Unicorn.

I'm quite happy with how clogger works, hopefully we find more happy
users :)  (I don't like relying on unicorn to promote clogger, though.
clogger should be able to stand on its own since it works with any Rack
server).

> Any idea of how to have some kind of useful information when master
> process kills workers by timeout?

It's not possible to know what a worker is doing since SIGKILL isn't
trappable.  The master killing workers should only be a last resort
that'll let you limp by until you can have a proper fix.  The the rest
of the app should have local timeouts for all non-deterministic calls.

> We just monkey patched Unicorn::HttpParser read method like this
> https://gist.github.com/1151164 to get more info. Is there a better
> way to do this?

There isn't any difference between that and having Rack middleware
at the top of your stack (clogger logs at the end, and if you have
things like $body_bytes_sent it even wraps the response body)

class LogBefore < Struct.new(:app)
  def call(env)
    env["rack.logger"].debug env["REQUEST_PATH"]
  end
end
--------- config.ru ---------
use LogBefore
use ...
use ...
use ...
run YourApp.new
-----------------------------
-- 
Eric Wong
_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

Reply via email to