Hi everyone,
A few days ago I received a call from the support team informing me that a specific request to Graphhopper was experiencing slow processing times. Isolating only the Graphhopper processing part, the request was taking approximately 50 seconds.
Upon analyzing the route, I noticed that there were over 100 restriction zones within the custom model, but I believe there may be other factors involved in causing the route to take so long to process. At the same day, I saw some OOM logs in the heap memory, and shortly after, Graphhopper restarted. This had never happened before, as my instance had been running with 120GB of RAM in a Kubernetes cluster for months with the same configuration.
After GH restarted, the slowness problem improved, taking approximately 25 seconds for the same route that previously took twice as long.
The JSON request is so large that I’ve attached the file here because it’s not possible to simply paste it. With this problem, some questions arose for me.
route.json (334.2 KB)
1 - How does Graphhopper handle avoidance areas that are not necessarily on the possible route?
2 - Is there any known performance issue that causes memory leaks in scenarios with avoidance areas?
3 - Is there any way for me to natively monitor routes that take longer than I would like, like a kind of time threshold?
I would like a little more detail to help me with some troubleshooting, even if it’s just in logs, because the logs being printed in my GKE workload end up being a bit inaccurate, like the example below.
2026-05-18 14:00:25.179 \[dw-6688 - POST /route?key=APIKEY\] INFO c.g.resources.RouteResource - 10.60.16.35 en_US Quarkus REST Client 3, took: 131.1 ms, algo: , profile: truck, custom_model: distanceInfluence=null|headingPenalty=null|speedStatements=[ ]|priorityStatements=\[{“if”: “road_environment == FERRY”, “multiply_by”: 0.1}\]|areas=[ ], alternatives: 1, distance0: 182410.90353499725, weight0: 8756.850132374395, time0: 143min, points0: 1887, debugInfo: idLookup:2.1568E-4s; , algoInit:1739 μs, astarbi|landmarks-routing:79 ms, path extraction: 53 μs, visited nodes sum: 69374, algoInit:1839 μs, astarbi|landmarks-routing:46 ms, path extraction: 37 μs, visited nodes sum: 112772