We currently using Kong as API Gateway(2.7.1
), to route the traffic to our backend service.
About 3000 routes is maintained and most of them is regex route
.
Everything works fine before we connected a new API to Kong last week, the CPU usage of Kong got a significant increment
The recent connected API has a special characteristic which would be invoke by a Uri with more than 3000 characters, moreover, such long Uri is contributed by many query parameters that is changed each time
According to the router.lua ,I found Kong would look up the cache firstly, if not ,then loop through the predefined routed to compare. Because the request Uri is changed each time, so there must be a cache miss,(if I was wrong please correct me ) ,I wonder if there is any performance issues in this context。
Before:
After: