title: Long response time from Amazon's S3 bucket
body: <p>I've started experiencing an unusual long response time (<strong>15s</strong>) for images in Amazon's S3 buckets. Most of the time is spent on <strong>waiting</strong>.</p>
  
  <p>I run on <strong>Heroku</strong>.</p>
  
  <p>This is the result of <strong>Apache benchmark</strong>:</p>
  
  <pre><code>Server Software:        AmazonS3
  Server Hostname:        bucket-name.s3.amazonaws.com
  Server Port:            80
  
  Document Path:          /4e846e6fb34c9490_unnamed.png
  Document Length:        118768 bytes
  
  Concurrency Level:      1
  Time taken for tests:   81.125 seconds
  Complete requests:      10
  Failed requests:        0
  Total transferred:      1191510 bytes
  HTML transferred:       1187680 bytes
  Requests per second:    0.12 [#/sec] (mean)
  Time per request:       8112.487 [ms] (mean)
  Time per request:       8112.487 [ms] (mean, across all concurrent requests)
  Transfer rate:          14.34 [Kbytes/sec] received
  
  Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        8   10   2.6     10      17
  Processing:   567 8102 7884.7  15572   15597
  Waiting:      294 7807 7901.0  15297   15311
  Total:        577 8112 7885.7  15581   15614
  
  Percentage of the requests served within a certain time (ms)
    50%  15581
    66%  15586
    75%  15587
    80%  15598
    90%  15614
    95%  15614
    98%  15614
    99%  15614
   100%  15614 (longest request)
  </code></pre>
  
  <p>And the <strong>request headers</strong>:</p>
  
  <pre><code>Remote Address:54.231.15.17:80
  Request URL:http://bucket-name.s3.amazonaws.com/8118c4f0a203c368_roadmapimage.png
  Request Method:GET
  Status Code:200 OK
  Request Headers
  Accept:image/webp,*/*;q=0.8
  Accept-Encoding:gzip,deflate,sdch
  Accept-Language:en-US,en;q=0.8,he;q=0.6
  Cache-Control:no-cache
  Connection:keep-alive
  Host:bucket-name.s3.amazonaws.com
  Pragma:no-cache
  Referer:http://app-name.herokuapp.com/public/prism/7814? token=48890cb264&amp;em=lili.test922@yopmail.com&amp;fn=lili&amp;ln=test922
  User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)     Chrome/38.0.2125.111 Safari/537.36
  Response Headers
  Accept-Ranges:bytes
  Content-Length:577016
  Content-Type:image/png
  Date:Sun, 07 Dec 2014 13:23:11 GMT
  ETag:"3709113ba6efc237617eda7e64afac89"
  Last-Modified:Sat, 06 Dec 2014 00:52:29 GMT
  Server:AmazonS3
  x-amz-id-2:UeaGp+Ahxb2M4XQTFCZ3HHSYNend6RvO1QowbUzMJtyd82NyS7yrp86mydu23mYI
  x-amz-request-id:70FD6E3158B45C6B
  </code></pre>