Cache Hit Latency for large responses.

lovekmla nginx-forum at
Thu May 1 22:27:19 UTC 2014

I am currently using nginx to serve as a Response Cache Proxy in order to
shim-out (isolate) network latency while running some performance related

The Perf Tests are comprised of 50 repetitions of the same set of requests.
=> I have been able to successfully set-up the proxy_cache so that it would
Cache the requests. 
(I'm using the request_uri and request_body as the cache_key, since I need
to Cache POST Requests as well)
(Our POST Requests are not necessarily Write Requests since our API is using
the POST Params for cases where we need to specify longer Params that exceed
the limit on GET)
=> I am logging the Cache HIT Status and Request_time in the access_log and
basically, I am seeing a variance between 500 ms ~ 2 seconds for the Same
Request being Served from the Cache even when it's both a HIT. The Size of
the Response is around 170K, and the request_body length is 65k. Most of the
other HITS are like 0~100ms for request_time and only the ones that are made
around that huge request seems to have some latency.

#1 I'm using proxy_cache_path. Is it possible that disk I/O is causing this
latency? I thought the Filesystem Cache was able to handle these Cache HITs
in memory.

#2 When I set the cache_key to be a combination of the request_body and
request_uri itself, when it does the lookup, would it automatically pull
those and to the lookup as expected?

Posted at Nginx Forum:,249791,249791#msg-249791

More information about the nginx mailing list