From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-0.8 required=3.0 tests=AWL,BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,URIBL_BLOCKED shortcircuit=no autolearn=no version=3.3.2 X-Original-To: unicorn-public@bogomips.org Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1E7C763380A for ; Sat, 22 Nov 2014 03:15:31 +0000 (UTC) Received: by mail-ob0-f178.google.com with SMTP id gq1so4915103obb.23 for ; Fri, 21 Nov 2014 19:15:30 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.202.183.84 with SMTP id h81mr4952324oif.19.1416626130287; Fri, 21 Nov 2014 19:15:30 -0800 (PST) Received: by 10.202.185.135 with HTTP; Fri, 21 Nov 2014 19:15:30 -0800 (PST) In-Reply-To: References: <20141120215923.GA24676@dcvr.yhbt.net> <20141121003137.GA31484@dcvr.yhbt.net> Date: Fri, 21 Nov 2014 19:15:30 -0800 Message-ID: Subject: Re: Unicorn configuration to increase max header size From: Jim Zhan To: Eric Wong Cc: unicorn-public@bogomips.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: PublicInbox::Filter 0.0.1 List-Id: 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 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 wrote: > >> Jim Zhan wrote: >> > Hi Eric, >> > >> > Thank you for the quick reply. I checked out hosts and we are using >> Unicorn >> > 3.4.1. Unfortunately there is only one setting for >> client_body_buffer_size. >> > So how does this parameter work? Will it only put a limitation on the >> body >> > 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: >> >> >> http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers >> >> 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 >> seeing: >> >> 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)" >> >> 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 >> -------------------------------- >> > >