我已经设置了一个responseCache,并根据github中的示例为缓存命中和未命中添加了一个标头。响应似乎按预期工作,其中第一次调用特定键返回未命中,但第二次返回标题中的命中。问题是即使在缓存命中时似乎也存在很多延迟。在500毫秒 - 1000毫秒的范围内,这对我来说似乎真的很高。这是因为它是在开发者帐户上吗?
我也尝试了跟踪,这些响应看起来很快就像预期的那样快,比如20毫秒,但是我的笔记本电脑中的应用程序却没有。
以下是10K请求的一些细节。
将这些时间与stackoverflow.com进行比较,例如(已登录),这是200ms,页面数据为40K。为了好玩,我向系统添加了stackoverflow并启用了缓存并得到了类似的非常慢的响应。
ab -n 100 -c 1 http://frank_zivtech-test.apigee.net/schedule/get?date=12/12/12
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking frank_zivtech-test.apigee.net (be patient).....done
Server Software: Apache/2.2.16
Server Hostname: frank_zivtech-test.apigee.net
Server Port: 80
Document Path: /schedule/get?date=12/12/12
Document Length: 45664 bytes
Concurrency Level: 1
Time taken for tests: 63.421 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 4640700 bytes
HTML transferred: 4566400 bytes
Requests per second: 1.58 [#/sec] (mean)
Time per request: 634.208 [ms] (mean)
Time per request: 634.208 [ms] (mean, across all concurrent requests)
Transfer rate: 71.46 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 36 47 20.8 43 166
Processing: 385 587 105.5 574 922
Waiting: 265 435 80.7 437 754
Total: 428 634 114.6 618 1055
Percentage of the requests served within a certain time (ms)
50% 618
66% 624
75% 630
80% 652
90% 801
95% 884
98% 1000
99% 1055
100% 1055 (longest request)
这里使用的是带有不同缓存端点的webpagetest.org,数据非常少:
答案 0 :(得分:0)
这与免费与付费帐户无关。
如果跟踪显示在Apigee上花费的时间约为20毫秒,我会考虑从客户端(笔记本电脑)到Apigee的网络延迟。客户端和Apigee之间的时间也可能更高,具体取决于有效负载大小以及是否压缩(gzip,deflate)。