Route Caching and Latency

Hi there,

When I add a new route, does this cause the proxy cache in Kong to be invalidated in its entirety or maybe selectively? Reason I ask is that I’m seeing increased latency when running siege against the proxy at the same time as I’m adding new routes via the admin api. I’m also running Cassandra across multi-dc’s so I’m not sure whether that might be causing an issue.

Thanks,

Lee

AFAIK router is rebuild when you add route.

Here we register the event:

And here we rebuild router:

Great. Thanks for the info.

This thread is interesting, so it appears any time a new service or route is published all routes or services will be invalidated on that Kong node? Luckily in a production environment the adding of services/routes will only occur a few times in a day and mostly in the evening so hopefully this is not too much of an impact.

I was thinking it may pre-warm and swap out the cache when ready. This would stop the slowdown by serving new requests via the incoming cache and draining the old one. You could also segment it in some way so that the whole cache didn’t need to be invalidated.

We’re planning on adding routes very regularly as we have different ACLs for each route. I’m now thinking of writing a custom ACL plugin to manage this independent of routes.

1 Like