| Forum | GitHub | Maps | Blog

Optimization for Route API


Hello guys. I’m working with GraphHopper Open Source and my main usage is for Route API.
Do you have any suggestion to improve the dataset for this API?

For example:
I’m using a cropped osm.pbf file. Can I keep only tags for the road network, to reduce the dataset size (if I can do it, which are the tags used on Route API)?

I don’t use Isochrone API, Map Matching API, and Geocoding API. Actually, I don’t even use the front-end. Can I remove these features to reduce some computational resource?

Thanks in advance :smile:


@karussell can you please mute him. It becomes annoying.

@Anyaoha please create your own thread if you have questions like @karussell just said to you in the last post? And stop hijacking other threads all the time.


I am also interested in this question. Am curious to know what you have tried / found out. I am also a user like you, not a developer.

I have looked at the map of a city and removed “tracks” and “footpaths” etc and reduced the size considerably. I only left primary, secondary, tertiary and a few other highways in. I found that it is indeed faster, by about 10%, and affects fastest more than shortest. It also depends on whether you use CH or not.


What are you requirements? Do you need to reduce RAM usage at query time or import time? Or do you mean something else?


For now, I only trimmed my database to improve the import time.
Some time ago I did something related for a research - I filtered some tags to improve an algorithm’ analysis time.

The import time is not so important for me because I can handle it on my load balancer health-checker. Anyway, could be amazing to reduce it too.

The RAM usage is the most important in my opinion.
Today I’m using AWS EC2 instances for high memory usage.
I can see the memory freeable always decreasing, even without use.

Another point: my usage is the Route API exclusively. How can I remove the ‘front-end’?


If query speed is sufficient you can try MMAP option for dataaccess but without SSD it will be much slower. It is always a balance of query speed, resources used when doing the import and RAM usage.

Another point: my usage is the Route API exclusively. How can I remove the ‘front-end’?

I suggest not to fork GH, instead create a custom MyApplication class in a project that depends on GH and then do not add the assets: