Long time CH importing with turn_costs

At the moment, I use LM profiles, my configurations:
3 GB OSM (pbf) file, 20 GB RAM

graph.elevation.dataaccess: RAM_STORE
prepare.lm.landmarks: 8
prepare.lm.threads: 8
routing.lm.active_landmarks: 8

I use standard profile

     - name: car
       vehicle: car
       weighting: short_fastest
       distance_factor: 0.1
       turn_costs: true
       u_turn_costs: 60

Importing an LM profile on my server takes about 20 minutes. But the CH profile import takes several hours. When turn_costs=false, the import is faster (although longer than 20 minutes, I forgot exactly how much).

turn_costs=true requires a lot more RAM.

Advise how you can speed up the import process?

I use latest 4.0 version. Can I use master branch for prod?

Yes, CH with turn costs takes a lot longer to prepare than without and also more memory. This is expected and there is no real way around it. You can find a few numbers in this (somewhat outdated) issue: https://github.com/graphhopper/graphhopper/issues/1565.

Advise how you can speed up the import process?

You should check the memory usage of the process. When it is close to the limit the import will slow down a lot. Otherwise I don’t know about any easy ways to speed it up for version 4.0. However, I am working on this at the moment and I think the preparation time will be improved soon. You can already try this using this branch: https://github.com/graphhopper/graphhopper/tree/new_eb_ch_exp that will be merged into master hopefully within the next weeks.

Can I use master branch for prod?

Not sure about your exact requirements, but the master branch usually is kept in a stable state.

1 Like

@easbar thanks for the perfect answer! I’ll try your branch.

Ok nice. Don’t hesitate to share your results here. I just ran the preparation for the car profile with fastest weighting and u_turn_costs=40 in 3.5h for the Europe map (29.8G).

Sure, I’ll test master and your branch, then I’ll share my results.

how much RAM are you using?

I used -Xmx118g -Xms118g but just because I had the memory available and I did not try with less. I just noticed that there are still some tests failing for my branch, but will fix as soon as I found the cause. Update: I fixed this.

It seems that at the time of my first tests, my server was overloaded. Repeated tests showed better results. My test results reported here: https://github.com/graphhopper/graphhopper/issues/1565#issuecomment-1048519705

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.