High x-kong-proxy-latency


I have the following configuration: 1 kong node connected to a cassandra cluster with 3 nodes.

I have an issue with my kong environment: I have figured out that the first request on kong had always a very high x-kong-proxy-latency (5~7 seconds). I have always thought it was normal due to some startup caching mechanism.

However, the latency issue comes regularly, after investigations I found out that it was when db_cache_ttl had expired that request had a high x-kong-proxy-latency.

Indeed, I’ve done the following test: When DB_CACHE_TTL is at 3600, during 1hour I don’t get any request with high x-kong-proxy-latency.
Then when I set DB_CACHE_TTL at 60, after 1 minute, I get a request with a high x-kong-proxy-latency.

Is there an issue with kong accessing to cassandra? I don’t have any plugin doing any calls to cassandra during request, could it be a cassandra client issue?

I’ve found this topic Small % of transactions have massive latency spike but putting DB_CACHE_TTL at 0 is clearly not a solution

EDIT: after upgrading from 1.0.0 to 1.0.3 the latency has been reduced (from 7sec to 2)


We now recommend setting db_cache_ttl to 0, since 0.14 lord (see changelog). The cache will not expire and you will avoid runtime cache misses and rebuilds.