Request-URI Too Long from mongrel-unicorn

Eric Wong normalperson at yhbt.net
Wed Apr 11 20:30:54 UTC 2012


Nuo Yan <yan.nuo at gmail.com> wrote:
> In my understanding, the mongrel request uri limit is 12k. 

Correct, that's the entire REQUEST_URI, though:
  REQUEST_PATH?QUERY_STRING#FRAGMENT

> My request uri is certainly not that long (about 1445 bytes), but for
> some reason I'm getting  414 Request-URI Too Long from the server. 

Perhaps one of your URI components (perhaps REQUEST_PATH) is too long?

The current limits are as follows (in ext/unicorn_http/global_variables.h)

  DEF_MAX_LENGTH(REQUEST_URI, 1024 * 12);
  DEF_MAX_LENGTH(FRAGMENT, 1024); /* Don't know if this length is specified somewhere or not */
  DEF_MAX_LENGTH(REQUEST_PATH, 1024);
  DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));

I will consider upping REQUEST_PATH to 4096 (and REQUEST_URI to 15K)
since 4096 is a common filesystem PATH_MAX on modern systems.

Would anybody object to this?  Given we already allow huge headers and
Ruby uses quite a bit of memory, I don't think a potential extra 3K
will negatively impact anybody.


More information about the mongrel-unicorn mailing list