unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Rack env rack.multiprocess true with single worker
Date: Thu, 18 Oct 2012 07:53:02 +0000	[thread overview]
Message-ID: <20121018075302.GA961@dcvr.yhbt.net> (raw)
In-Reply-To: <507FA2C9.2070300@gentoo.org>

Petteri Räty <betelgeuse@gentoo.org> wrote:
> Hi,
> unicorn unconditionally sets rack.multiprocess to true in the Rack
> environment. The Rack spec [0] says the following about the variable:
> 
> "true if an equivalent application object may be simultaneously invoked
> by another process, false otherwise."
> 
> When unicorn is running with a single worker this does not hold so what
> do you think about setting the variable to false when only a single
> worker is configured? I want to use the variable to check if I can do a
> HTTP call back to the application (long story) but currently with
> unicorn and single worker this is not possible.

We cannot safely set rack.multiprocess=false.

Even if unicorn is started with a single worker, it is possible
to start more workers via SIGTTIN, and the first worker would
never see the change.


However, if you're certain nobody on your server will use SIGTTIN,
you can set the following anywhere in your unicorn config file:

	Unicorn::HttpRequest::DEFAULTS["rack.multiprocess"] = false

Changing the DEFAULTS constant has been and will remain supported
for as long as this project supports Rack 1.x (forever? :)


Since a single process deployment is a corner-case in production
deployments, I don't think it's worth the effort to jump through hoops
and set rack.multiprocess=false automatically.
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

  reply	other threads:[~2012-10-18  7:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  6:33 Rack env rack.multiprocess true with single worker Petteri Räty
2012-10-18  7:53 ` Eric Wong [this message]
2012-10-18  8:52   ` Petteri Räty
2012-10-18 17:38     ` Eric Wong
2012-10-18 18:11       ` Devin Ben-Hur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121018075302.GA961@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).