Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Mar 20, 2012
  1. examples/nginx.conf: use $scheme instead of hard-coded "https"

    Eric Wong authored
    This adds a little more flexibility to the nginx config,
    especially as protocols (e.g. SPDY) become more prevalent.
    Suggested-by: Eike Herzbach <>
  2. examples/nginx.conf: remove redundant word

    Eric Wong authored
    From: Eike Herzbach <>
Commits on Jan 28, 2012
  1. doc: update doc for Ruby 2.0.0dev CoW-friendliness

    Eric Wong authored
    Ruby 2.0.0dev is the future and includes a CoW-friendly GC,
    so we shall encourage folks to give Ruby 2.0.0dev a spin.
Commits on Jun 7, 2011
  1. examples/nginx.conf: better wording for ipv6only comment

    Eric Wong authored
  2. examples/nginx.conf: add ipv6only comment

    Eric Wong authored
    IPv4-mapped-IPv6 addresses are fugly.
Commits on Apr 29, 2011
  1. oob_gc: reimplement to fix breakage and add tests

    Eric Wong authored
    This was broken since v3.3.1[1] since nginx relies on a closed
    socket (and not Content-Length/Transfer-Encoding) to detect
    a response completion.  We have to close the client socket
    before invoking GC to ensure the client sees the response
    in a timely manner.
    [1] - commit b72a86f
  2. examples/big_app_gc: fix comment

    Eric Wong authored
    Oops, comments should match the latest code
  3. examples/big_app_gc: update this example

    Eric Wong authored
    OobGC is actually broken with nginx these days since
    we needed to preserve the env for body.close...
Commits on Apr 27, 2011
  1. examples/nginx.conf: clarify proxy_buffering for Rails 3.1

    Eric Wong authored
    I've tested with nginx 1.0.0 and confirmed "proxy_buffering off;"
    can cause Unicorn to block on a slow client reading a
    large response.  While there's a potential (client-visible)
    performance improvement with Rails 3.1 streaming responses, it
    can also hurt the server with slow clients.
    Rainbows! with (ThreadSpawn or ThreadPool) is probably the best
    way to do streaming responses efficiently from all angles (from
    a server, client and programmer time perspective).
Commits on Apr 12, 2011
  1. @emmanuel

    Document "user" directive in example unicorn conf

    emmanuel authored Eric Wong committed
Commits on Mar 29, 2011
  1. add examples/logrotate.conf

    Eric Wong authored
    logrotate is the de facto tool for logrotation, so an
    example config for highlighting important parts are in order.
    Since our USR1 signal handling is part of the crusade against
    the slow and lossy "copytruncate" option, be sure to
    emphasize that :)
Commits on Jan 25, 2011
  1. examples/nginx.conf: use try_files directive

    Eric Wong authored
    This feature is in nginx 0.7.x and 0.8.x and optimized
    better than the "if" directive in nginx.conf
  2. examples/nginx: avoid unnecessary listen directive

    Eric Wong authored
    There's no need to use listen unless you use non-default port or
    can enable "deferred" or "httpready" (which you usually want).
Commits on Oct 27, 2010
  1. examples/unicorn.conf: add a note about throttling signals

    Eric Wong authored
    Sending the same signal faster than the receiver can process
    means signals can get lost.
Commits on Jun 11, 2010
  1. examples/init: "upgrade" task waits for completion

    Eric Wong authored
    This makes the user (sysadmin in this case) more aware if the
    upgrade fails or doesn't work as intended.  This change could be
    more useful for Rainbows! with its long-running responses.
Commits on Jun 4, 2010
  1. doc: emphasize the importance of stderr_path

    Eric Wong authored
    While second nature to myself, stderr_path may be an
    overlooked configuration parameter for some users.  Also,
    add a minimal sample configuration file that is shorter
    and hopefully less intimidating to new users.
Commits on May 6, 2010
  1. examples: add big_app_gc monkey patch

    Eric Wong authored
Commits on Feb 8, 2010
  1. examples/ add "reopen-logs" target

    Eric Wong authored
  2. examples/ reenable set -u

    Eric Wong authored
    This may be used as a basis of other scripts so we need
    to stash $1 before we "set -u"
Commits on Jan 26, 2010
  1. KNOWN_ISSUES: background threads + Logger monkey patch

    Eric Wong authored
    Thanks to Michael Guterl for informing us of the issues
    and testing the monkey patch.
Commits on Nov 24, 2009
  1. Add examples for nginx and unicorn

    Eric Wong authored
    These should help make things easier for folks unfamiliar
    with nginx setups.
Commits on Oct 9, 2009
  1. examples/ remove "set -u"

    Eric Wong authored
    It's too simple of a script and causes running the init script
    with zero arguments to fail instead of printing out the usage
Commits on Aug 18, 2009
  1. examples/echo: "Expect:" value is case-insensitive

    Eric Wong authored
    From RFC 2616, section 14.20:
    > Comparison of expectation values is case-insensitive for
    > unquoted tokens (including the 100-continue token), and is
    > case-sensitive for quoted-string expectation-extensions.
Commits on Jul 4, 2009
  1. Favor Struct members to instance variables

    Eric Wong authored
    There's a small memory reduction to be had when forking
    oodles of processes and the Perl hacker in me still
    gets confused into thinking those are arrays...
Commits on Jul 1, 2009
  1. Remove cat-chunk-proxy, curl CVS supports non-blocking stdin

    Eric Wong authored
    Now that upstream curl supports this functionality, there's
    no reason to duplicate it here as an example.
  2. Force streaming input onto apps by default

    Eric Wong authored
    This change gives applications full control to deny clients
    from uploading unwanted message bodies.  This also paves the
    way for doing things like upload progress notification within
    applications in a Rack::Lint-compatible manner.
    Since we don't support HTTP keepalive, so we have more freedom
    here by being able to close TCP connections and deny clients the
    ability to write to us (and thus wasting our bandwidth).
    While I could've left this feature off by default indefinitely
    for maximum backwards compatibility (for arguably broken
    applications), Unicorn is not and has never been about
    supporting the lowest common denominator.
Commits on Jun 7, 2009
  1. examples/cat-chunk-proxy: link to proposed curl(1) patch

    Eric Wong authored
    Then hopefully soon we'll be able to get rid of this script...
Commits on Jun 6, 2009
  1. Unicorn::App::Inetd: reinventing Unix, poorly :)

    Eric Wong authored
    This includes an example of tunneling the git protocol inside a
    TE:chunked HTTP request.  The example is unfortunately contrived
    in that it relies on the custom examples/cat-chunk-proxy.rb
    script in the client.  My initial wish was to have a generic
    tool like curl(1) operate like this:
      cat > ~/bin/ <<EOF
      exec curl -sfNT- http://$1:$2/
      chmod +x ~/bin/ git clone git://0:8080/foo
    Unfortunately, curl will attempt a blocking read on stdin before
    reading the TCP socket; causing the git-clone consumer to
    starve.  This does not appear to be a problem with the new
    server code for handling chunked requests.
  2. Transfer-Encoding: chunked streaming input support

    Eric Wong authored
    This adds support for handling POST/PUT request bodies sent with
    chunked transfer encodings ("Transfer-Encoding: chunked").
    Attention has been paid to ensure that a client cannot OOM us by
    sending an extremely large chunk.
    This implementation is pure Ruby as the Ragel-based
    implementation in rfuzz didn't offer a streaming interface.  It
    should be reasonably close to RFC-compliant but please test it
    in an attempt to break it.
    The more interesting part is the ability to stream data to the
    hosted Rack application as it is being transferred to the
    server.  This can be done regardless if the input is chunked or
    not, enabling the streaming of POST/PUT bodies can allow the
    hosted Rack application to process input as it receives it.  See
    examples/ for an example echo server over HTTP.
    Enabling streaming also allows Rack applications to support
    upload progress monitoring previously supported by Mongrel
    Since Rack specifies that the input needs to be rewindable, this
    input is written to a temporary file (a la tee(1)) as it is
    streamed to the application the first time.  Subsequent rewinded
    reads will read from the temporary file instead of the socket.
    Streaming input to the application is disabled by default since
    applications may not necessarily read the entire input body
    before returning.  Since this is a completely new feature we've
    never seen in any Ruby HTTP application server before, we're
    taking the safe route by leaving it disabled by default.
    Enabling this can only be done globally by changing the
    Unicorn HttpRequest::DEFAULTS hash:
      Unicorn::HttpRequest::DEFAULTS["unicorn.stream_input"] = true
    Similarly, a Rack application can check if streaming input
    is enabled by checking the value of the "unicorn.stream_input"
    key in the environment hashed passed to it.
    All of this code has only been lightly tested and test coverage
    is lacking at the moment.
    [1] -
Commits on Apr 29, 2009
  1. Add example init script

    Eric Wong authored
    This was done in Bourne shell because it's easier for UNIX
    sysadmins who don't know Ruby to understand and modify.
    Additionally, it can be used for nginx or anything else
    that shares compatible signal handling.
Commits on Mar 9, 2009
  1. Remove sinatra example

    Eric Wong authored
    It is no longer relevant (or working) with rackup compatibility.
Commits on Feb 11, 2009
  1. Add Sinatra example

    Eric Wong authored
Commits on Feb 2, 2009
  1. Realistic defaults.

    Evan Weaver authored
Commits on Jan 31, 2009
  1. Added simple rack application

    Ian Ownbey authored
Commits on Nov 22, 2008
  1. Removed examples and debug.rb.

    Evan Weaver authored
Something went wrong with that request. Please try again.