Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We appear to be encountering an error due to Amazon ELBs truncating a long (over 1K characters) URL.

I have searched through the usual suspects, but can't find any discussion of URL length limits for Amazon ELBs.

Is there a limit on the length of Amazon URLs? If so, is there a way to increase that limit?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I tested this with a simple bash script against a domain I have running behind an ELB:

S='a';
URL='http://example.com/?foo=';
while true;
do
  echo $URL$S | wc -c;
  curl -I "$URL$S";
  S=$S$S;
done

This worked fine for a while:

2081
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Date: Tue, 05 Feb 2013 15:01:44 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Connection: keep-alive

4129
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Date: Tue, 05 Feb 2013 15:01:46 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Connection: keep-alive

But failed once it crossed the 8192 length barrier:

8225
HTTP/1.1 414 Request-URI Too Large
Content-length: 337
Content-Type: text/html; charset=iso-8859-1
Date: Tue, 05 Feb 2013 15:01:47 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Connection: keep-alive

16417
HTTP/1.1 414 Request-URI Too Large
Content-length: 337
Content-Type: text/html; charset=iso-8859-1
Date: Tue, 05 Feb 2013 15:01:47 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Connection: keep-alive

The failing requests were logged in a different file by Apache because the GET string comes before the Host: header and hence Apache didn't ever determine which vhost to use.

Nonetheless, it was still Apache responding, and not the ELB, even up to over 128KB in a single GET string. The full 128KB request was logged in the default Apache log file. After 256KB, curl failed to process the request.

It doesn't look like there's any URL length limit in Amazon ELBs.

share|improve this answer
    
Very helpful. Thank you. My next step would have been to run the same experiment you ran. Thank you very much. –  Jordan Feb 5 '13 at 22:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.