2014-12-07 168 views
0

对于亚马逊S3存储桶中的图像,我开始体验到不寻常的长响应时间(15s)。大部分时间用于等待。我在Heroku上运行。来自亚马逊S3存储桶的响应时间很长

这是阿帕奇基准结果:

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) 

而且请求头

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&[email protected]&fn=lili&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 
+0

尝试指定完整的端点URL,http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region – Anatoly 2014-12-12 23:02:44

回答

0

与亚马逊的支持下无尽的会谈结束后,没有一个真正的解决方案的任何进步,许多失望的客户,解决方法是添加一个CDN,其原点指向S3存储桶。它极大地改善了延迟。

这不是问题的直接解决方案,但它是反正静态资产的正确方法。