GraphHopper.com | Forum | GitHub | Maps | Blog

Installing Graphhopper on a Windows Server


#1

I’m looking for advice on installing the Graphhopper routing engine on a Windows server. I’ve tried following the Quick Start instructions (https://github.com/graphhopper/graphhopper/blob/0.5/docs/web/quickstart.md) but get stuck at step 3, when I try to start Graphhopper Maps. I get the following error message:

“If no graph.location is provided you need to specify an OSM file”

This is the command I’m running:

java -jar C:\Graphhopper\graphhopper-web-0.10-0-with-dep.jar jetty.resourcebase=webapp config= C:\Graphhopper\config-example.properties datareader.file= C:\Graphhopper\berlin-latest.osm.pbf

I’ve already changed the parameter “osmreader.osm” as it gave an error message saying that this has been replaced with the parameter “datareader.file”. I have the file “berlin.latest.osm.pbf” in the specified folder.

Can anyone help?

Thanks,

John


#2

Sorry, my mistake - I had a rogue space character in the command!


#3

I’ve progressed a bit further with this but I’ve hit another stumbling block!

When I run the java command to build the graph for planet-latest.osm.pbf it gets so far then gets stuck, despite leaving it running for 24 hours. I’m using a Dell PowerEdge R710 windows server with 96GB of RAM and 2 x 3.06GHz Hex-Core processors, so I’m guessing this is powerful enough to do the job, as the server isn’t being used for any other tasks. At one point in messages being output it says “OutOfMemoryError: Java heap space” but there is plenty of memory on the server, so I don’t know if this is just a spurious warning message.

When I run the java command with the berlin-latest-pdf fiile it runs successfully in under a minute. Any ideas of what might be going wrong?


#4

You need to increase the -Xmx setting. See a few more tips here https://github.com/graphhopper/graphhopper/blob/master/docs/core/deploy.md


#5

Thanks. I tried adding “-Xmx17000m -Xms17000m” to the java command, which is what was suggested for worldwide coverage, but it gave the following error:

Invalid maximum heap size: -Xmx17000m
The specified size exceeds the maximum representable size.


#6

It looks like the latest error was due to me using the 32Bit version of Java instead of the 64Bit version! I’ve reinstalled Java so fingers crossed!


#7

I’ve added “-Xmx17000m -Xms17000m” to the java command. It runs for longer but I’m still getting OutOfMemory errors. Is it a case of trial and error with these settings (increasing them from 17000 until it runs OK), or is there a value at which it should always work?


#8

The rule of thumb is to look how much space the folder uses on your disc and then add 2GB or a bit more depending on the actual volume and usage or … just use 80% of the server capacity :wink:
(It is recommended to keep Xmx under 95% of the server RAM if there are no other services on it)


#9

I managed to get it to work with -Xmx and -Xms set to 70000m. It took 16 hours to generate a worldwide graph for single profile (car) and 61 hours to generate one for 3 profiles (car, hike and mtb)! This was on a machine with 96GB of RAM and 2 x 3.06 GHz Hex-Core processors. Is there anything I can do to speed up the graph generation?

I’m only interested in the shortest routes (not the fastest) so I’m using prepare.ch.weightings=shortest but I wasn’t sure if there were any other settings I could change that were slowing things down unnecessarily. I would appreciate any advice?

Thanks.

John


#10

You can calculate the 3 profiles in parallel. But this might require even more RAM.

I’m only interested in the shortest routes (not the fastest)

We highly recommend against shortest. Shortest often does not make sense, especially for car or mtb/bike where you have several things to consider for the usual best route.

(And also shortest might compile slower due to reduced hierarchy)


#11

I’ve managed to get it up and running successfully! Thanks for your help. I’ve stuck with the Shortest profile for now - this works well in my use case as people are plotting routes by hand, with only a very short distance between the points, typically less than 500m.

There is one more thing I’m struggling with. I’m not sure what settings I need to use in the config file to be able to support the “avoid” parameter in requests. Requests with this parameter fail with my current settings.


#12

What error message do you get? You have to disable CH to make this working, and so either LM or slower A* will be used.


#13

I get message “Disabling CH not allowed on the server-side” if I add “&ch.disable=true&avoid=motorway” to the request. If I leave out “ch.disable=true” but still include “avoid=motorway” it seems to accept this but still routes on a motorway even though there is an alternative of a similar distance.


#14

You can allow “disabling CH” on the server side via:

routing.ch.disabling_allowed=true

or for master (>=0.11) und the graphhopper: section do:

routing.ch.disabling_allowed: true

(to make this effective - just restart GH)