Whole planet OSM import. No nodes left after PrepareRoutingSubnetworks

Hi!
I am trying to build routing graph for the planet.
My setup looks like:

hopper.setGraphHopperLocation(GRAPH_FOLDER);
hopper.setEncodingManager(EncodingManager.create("car,foot,bike", 8));
hopper.setMinNetworkSize(50, 50);
CHAlgoFactoryDecorator chFactoryDecorator = hopper.getCHFactoryDecorator();
chFactoryDecorator.setPreparationThreads(10);

After a while, I got these log messages and CPU usage dropped without any further log messages. No crash messages, no emptiness warning, silence. And no data in GraphHopperLocation as well.
What could it be and how can I fix it?

Logs:

INFO  [2020-05-04 01:24:05,250] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: car-access|version=-873064876|bits=1|index=0|shift=1|store_both_directions=true findComponents time:3.7969537, size:0
INFO  [2020-05-04 01:24:47,365] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: 161010739 subnetworks found for car, totalMB:30024, usedMB:16064
INFO  [2020-05-04 01:24:49,925] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: foot-access|version=465541260|bits=1|index=0|shift=8|store_both_directions=true findComponents time:2.5594301, size:0
INFO  [2020-05-04 01:25:21,380] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: 161010739 subnetworks found for foot, totalMB:30680, usedMB:18291
INFO  [2020-05-04 01:25:24,115] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: bike-access|version=-549158369|bits=1|index=0|shift=17|store_both_directions=true findComponents time:2.735549, size:0
INFO  [2020-05-04 01:25:55,356] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: 161010739 subnetworks found for bike, totalMB:30688, usedMB:17016
INFO  [2020-05-04 01:25:57,224] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: optimize to remove subnetworks (161010739), unvisited-dead-end-nodes (0), maxEdges/node (0)
WARN  [2020-05-04 01:25:57,839] com.graphhopper.storage.BaseGraph: More than a half of the network should be removed!? Nodes:161010739, remove:161010739

Thank you!

WARN  [2020-05-04 01:25:57,839] com.graphhopper.storage.BaseGraph: More than a half of the network should be removed!? Nodes:161010739, remove:161010739

This is a very bad sign that something is wrong: the entire road network gets removed because it is not accessible for all vehicles somehow. Does this work for smaller files? Are you using an unmodified GraphHopper? If yes, which version and can you reproduce this problem for a smaller area that I can try?

chFactoryDecorator.setPreparationThreads(10);

Please note, that a CH preparation consumes a lot of memory and so use parallel threads only if it worked for 1 thread for you before. Additionally, as you have 3 vehicles added, GraphHopper can only utilize 3 threads maximum.

Hi karusell, thank you for your answer! I run docker before and feed it with smaller graphs, it worked perfectly on my local machine.
Then I decided to embed the GH into my application and run it in k8s with persistentVolume mounted for pbf- and gh-files. I tried to run app for smaller graph but only on my machine. I feel it will work in k8s as well, but I will try.
Then I will try to build “car” with 1 preparationThread, and write here.

Hi karusell, I got OOM. How much memory is required to build a graph for car with CH?

We have a different setup for production so I cannot comment on car-only but you can try e.g. with 30GB. If you set the mmap option you can decrease this memory requirement a lot.

Hi,

Short update from me. I run importing whole planet. The process seemed to finish but the file <graphlocation>/properties contains only zeros and gh can’t use this file to initialize.

I run it with mmap option and 40G of RAM.
In the logs I didn’t see message like flushing graph... which I see in testing environment while importing small graphs.

The last messages I saw were:

INFO  [2020-05-08 13:08:22,690] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: start finding subnetworks (min:200, min one way:0) totalMB:40960, usedMB:21306
INFO  [2020-05-10 02:33:30,665] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: 2018834 subnetworks found for car, totalMB:40960, usedMB:9585
INFO  [2020-05-10 09:33:01,451] com.graphhopper.routing.subnetwork.PrepareRoutingSubnetworks: optimize to remove subnetworks (2018834), unvisited-dead-end-nodes (0), maxEdges/node (26)

The code initializing GH and the graph is:

        hopper = new GraphHopperOSM().forServer();
        hopper.setDataReaderFile(OSM_FILE);
        hopper.setMemoryMapped();
        hopper.setGraphHopperLocation(GRAPH_FOLDER);
        hopper.setEncodingManager(EncodingManager.create("car", 8));
        //        hopper.setMinNetworkSize(25, 25);
        CHAlgoFactoryDecorator chFactoryDecorator = hopper.getCHFactoryDecorator();
        chFactoryDecorator.setPreparationThreads(1);
        
        CompletableFuture.runAsync(hopper::importOrLoad);

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

Powered by Discourse