简体   繁体   中英

Slow apigee response on cached items

I've setup a responseCache and added a header for cache hits and misses based on the example in github. The responses seem to work as expected where the first call for a specific key returns a miss, but the second returns a hit in the headers. The problem is that there seems to be a lot of latency even on a cache hit. In the 500ms - 1000ms range, which seems really high to me. Is this because it's on a developer account?

I also tried the trace and those responses seem to be quick as expected, like 20 ms, but not in the app from my laptop in chrome.

Here are some details for the 10K request.

延迟分割时间详情

Compare those times to stackoverflow.com for example (logged in) which is 200ms and 40K for the page data. For fun, I added stackoverflow to the system and enabled the cache and got similar very slow responses.

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)

Here it is using webpagetest.org with a different cached endpoint with very little data:

http://www.webpagetest.org/result/140228_7B_40G/

This shouldn't be related to a free vs. paid account.

If trace is showing ~20ms for the time spent in Apigee, I would factor in network latency from your client (laptop) to Apigee. Time between the client and Apigee can also be higher depending on the payload size and if it is compressed (gzip, deflate).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM