From: Jim Zhan <firstname.lastname@example.org>
To: Eric Wong <email@example.com>
Subject: Re: Unicorn configuration to increase max header size
Date: Fri, 21 Nov 2014 19:15:30 -0800 [thread overview]
Message-ID: <CAD6h1mjXTULY6Xn2d6HLK5=nq7_vx=DZn7uZonqB6TiZrO=MGw@mail.gmail.com> (raw)
Tried out and indeed it is because of the header size limitation of load
balancer, not the rails app itself. Thank you for your answer!
On Thu, Nov 20, 2014 at 5:33 PM, Jim Zhan <firstname.lastname@example.org> wrote:
> Thank you. Will check out tomorrow on our production hosts based on your
> comments and directions.
> On Thu, Nov 20, 2014 at 4:31 PM, Eric Wong <email@example.com> wrote:
>> Jim Zhan <firstname.lastname@example.org> wrote:
>> > Hi Eric,
>> > Thank you for the quick reply. I checked out hosts and we are using
>> > 3.4.1. Unfortunately there is only one setting for
>> > So how does this parameter work? Will it only put a limitation on the
>> > itself or it applied proportionally to header and body (e.g., header 8k,
>> > body 104k, etc).
>> client_body_buffer_size in unicorn is only for request bodies (uploads),
>> and not relevant to header sizes.
>> > We did experiments using curl by sending header exceeding 8k manually
>> and I
>> > am getting 404. So it's unicorn itself, not nginx that has the 8k header
>> > size limitation.
>> I suspect you're hitting the nginx large_client_header_buffers default
>> limit of 8K:
>> I checked the unicorn source, and ext/unicorn_http/global_variables.h
>> defines the maximum field value as 80K, 10 times more than what you're
>> DEF_MAX_LENGTH(FIELD_VALUE, 80 * 1024);
>> This value was inherited from Mongrel many years ago and never changed.
>> > The command we used for the experiment:
>> > curl -v -H "$(./http-header-pumper.bat 8000)" <service_url>
>> I just tried your script with the following config.ru to hit unicorn
>> directly (no nginx), and I got the expected lobster response.
>> $ unicorn -E none config.ru
>> ----------- config.ru -----------
>> require 'rack/lobster'
>> use Rack::ContentLength
>> run Rack::Lobster.new
prev parent reply other threads:[~2014-11-22 3:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 21:54 Unicorn configuration to increase max header size Jim Zhan
2014-11-20 21:59 ` Eric Wong
2014-11-20 23:35 ` Jim Zhan
2014-11-21 0:31 ` Eric Wong
2014-11-21 1:33 ` Jim Zhan
2014-11-22 3:15 ` Jim Zhan [this message]
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:
List information: https://yhbt.net/unicorn/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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
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).