Thousands of routes

Hi there,

Does anyone have any experience with thousands of routes?

The thing is our clients can customize our endpoints and by doing that another service would handle the request.

The first option we thought of was to create a route per customized endpoint with a header check, so kong would redirect to the right service. Currently we have less than a thousand customizations, but the problem is that this number could increase a lot over time and we don’t know how its gonna be.

I did a test with 20k routes and didn’t notice any underperforming, the only thing is that it increased 500~600 mb of kong’s pod memory after initialization because of its in-memory cache.

Is there a recommended number of routes to be taken into account as best practices? Did someone already experience something like this?

In order not to be at mercy of that, another option we are studiyng is to create a plugin with a custom entity which will have only the informations needed to redirect the request to another route. So kong would warmup the custom entity on its in-memory cache and the plugin would basicly check it and redirect if necessary. I haven’t test the performance yet, but pod’s memory increased only 60mb with 20k records.

1 Like