我已经开始在亚马逊的S3存储桶中遇到异常长的响应时间( 15s )。大部分时间花在等待上。
我在 Heroku 上运行。
这是 Apache基准的结果:
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&em=lili.test922@yopmail.com&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 :(得分:0)
经过与亚马逊的支持无休止的谈话,没有任何进展到真正的解决方案和许多失望的客户,解决方法是添加 CDN ,其原点指向S3存储桶。它大大改善了延迟。
这不是问题的直接解决方案,但它仍然是提供静态资产的正确方法。