We have tested the QPS for the route service. Results as below:
based on China map:
with custom model: 50 QPS
without custom model: 500 QPS
based on Monaco map:
with custom model: 1400 QPS
without custom model: 1600 QPS
while the performance is significant different with bigger and smaller maps.
So my question will be:
Is there any way to improve performance with bigger maps? eg, are we able to restrict the seach area per request to increase qps? As in most cases, we don’t need route across the contry but in cities, if we could define the seach area, is it possible to reduce the calculationt time?
Did you only increase the map size (China instead of Monaco) or did you also use origins/destinations that were further apart? The map size can be significant for performance, but the distance between origin and destination is even more critical. It would not make sense to compare random queries across China with queries across Monaco for example. So a better experiment would be using a small map of some part of China (say one city) and then a bigger map of all of China, but only run the queries within the that city (the area of the small map). I would expect the performance difference to be much smaller than what you saw.
And do you even change the custom model per request? Otherwise you can just use CH for both your profiles and they should be equally fast.
You should also take a look at the runtime distribution of your requests. I assume there are some requests that are much slower than others?
GraphHopper has an option to limit the number of visited nodes per request: You can use something like max_visited_nodes=100 for your request or routing.max_visited_nodes: 100 in your server-side config and this will limit the number of visited nodes to 100. If the destination has not been found when the limit is reached you will get a ‘connection not found’ error.
The other thing you could try is landmark area splitting. This allows you to split your map into separate regions (you won’t be able to route from one to the other), but query speed could be faster. Or maybe all you need is increasing the number of landmarks (take a look at LMPreparationHandler)
Both map files are download and graph generated with same configuration.
As we can’t find a osm file per city for China, maybe I shall try to export from the openstreetmap.
We composed the request with similar distance from start and destination with similar custom model, block a polygon.
Will try as a smaller part and bigger map file with same city.
The service is not published yet, only one client during the test.
Will try this option. Hope we won’t get the error ‘connection not found’;