Skip to content

Commit 544b2ac

Browse files
committed
Merge pull request graphhopper#595 from boldtrn/feature_deploy_documentation
Added Deploy Information
2 parents 5d8e228 + 22239b5 commit 544b2ac

File tree

4 files changed

+69
-51
lines changed

4 files changed

+69
-51
lines changed

docs/core/deploy.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Deploy Guide
2+
3+
This guide is written for everyone interested in deploying graphhopper on a server.
4+
5+
## Basics
6+
7+
For simplicity you could just start jetty from maven and schedule it as background job:
8+
`export GH_FOREGROUND=false && export JETTY_PORT=11111 && ./graphhopper.sh web europe_germany_berlin.pbf`.
9+
Then the service will be accessible on port 11111.
10+
11+
For production usage you can install the latest jetty (8 or 9) as a service but we prefer to have it bundled as a
12+
simple jar. Tomcat should work too. To create a war file do `mvn clean install war:war` and copy it from the target/
13+
folder to your jetty installation. Then copy web/config.properties also there and change this properties
14+
file to point to the required graphhopper folder. Increase the Xmx/Xms values of your jetty server e.g.
15+
for world wide coverage with a hierarchical graph do the following in bin/jetty.sh
16+
```
17+
bash
18+
export JAVA=java-home/bin/java
19+
export JAVA_OPTIONS="-server -Xconcurrentio -Xmx17000m -Xms17000m"
20+
```
21+
22+
Important notes:
23+
24+
* jsonp support needs to be enabled in the config.properties
25+
* none-hierarchical graphs should be limited to a certain distance otherwise you'll require lots of RAM per request! See [#104](https://github.com/graphhopper/graphhopper/issues/104)
26+
* if you have strange speed problems which could be related to low memory you can try to [entire disable swap](http://askubuntu.com/questions/103915/how-do-i-configure-swappiness). Or just try it out via `sudo swapoff -a`. Swapping out is very harmful to Java programs especially when the GC kicks in.
27+
28+
### API Tokens
29+
30+
By default, graphhopper uses [Omniscale](http://omniscale.com/) as layer service.
31+
Either you get a plan there or you have to remove Omniscale from the [JavaScript file](https://github.com/graphhopper/graphhopper/blob/master/web/src/main/webapp/js/main.js).
32+
33+
## World Wide
34+
35+
GraphHopper is able to handle coverage for the whole [Openstreetmap road network](http://planet.osm.org/).
36+
It needs approximately 22GB RAM for the import (CAR only) and ~1 hour (plus ~5h for contraction).
37+
If you can accept slower import times this can be reduced to 14GB RAM - you'll need to set osmreader.dataaccess=MMAP
38+
39+
Then, to run the web service with this world wide graph 'only' 15GB are necessary. Without contraction hierarchy
40+
this would be about 9GB.
41+
42+
With CH the service is able to handle about 180 queries per second (from localhost to localhost this was 300qps).
43+
Measured for CAR routing, real world requests, at least 100km long, on a linux machine with 8 cores and 32GB,
44+
java 1.7.0_25, jetty 8.1.10 via custom QueryTorture class (10 worker threads).
45+
46+
### JVM
47+
48+
If GC pauses are too long try `-XX:+UseG1GC`
49+
50+
### Elevation Data
51+
52+
If you want to use elevation data you need to increase the allowed number of open files. Under linux this works as follows:
53+
54+
* sudo vi /etc/security/limits.conf
55+
* add: `* - nofile 100000`
56+
which means set hard and soft limit of "number of open files" for all users to 100K
57+
* sudo vi /etc/sysctl.conf
58+
* add: `fs.file-max = 90000`
59+
* reboot now (or sudo sysctl -p; and re-login)
60+
* afterwards `ulimit -Hn` and `ulimit -Sn` should give you 100000
61+
62+
63+
### TODOs
64+
65+
* Try out to disable NUMA -> http://engineering.linkedin.com/performance/optimizing-linux-memory-management-low-latency-high-throughput-databases

docs/core/quickstart-from-source.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,7 @@ The routing API (json,jsonp,gpx) is optimized regarding several aspects:
7777

7878
#### Routing Service Deployment
7979

80-
For simplicity you could just start jetty from maven and schedule it as background job:
81-
`export GH_FOREGROUND=false && export JETTY_PORT=11111 && ./graphhopper.sh web europe_germany_berlin.pbf`.
82-
Then the service will be accessible on port 11111.
83-
84-
For production usage you can install the latest jetty (8 or 9) as a service but we prefer to have it bundled as a
85-
simple jar. Tomcat should work too. To create a war file do `mvn clean install war:war` and copy it from the target/
86-
folder to your jetty installation. Then copy web/config.properties also there and change this properties
87-
file to point to the required graphhopper folder. Increase the Xmx/Xms values of your jetty server e.g.
88-
for world wide coverage with a hierarchical graph I do the following in bin/jetty.sh
89-
```bash
90-
export JAVA=java-home/bin/java
91-
export JAVA_OPTIONS="-server -Xconcurrentio -Xmx17000m -Xms17000m"
92-
```
93-
94-
For [World-Wide-Road-Network](./world-wide.md) we have a separate information page.
95-
96-
Important notes:
97-
* jsonp support needs to be enabled in the config.properties
98-
* none-hierarchical graphs should be limited to a certain distance otherwise you'll require lots of RAM per request! See [#104](https://github.com/graphhopper/graphhopper/issues/104)
99-
* if you have strange speed problems which could be related to low memory you can try to [entire disable swap](http://askubuntu.com/questions/103915/how-do-i-configure-swappiness). Or just try it out via `sudo swapoff -a`. Swapping out is very harmful to Java programs especially when the GC kicks in.
80+
If you want to setup graphhopper on your own server, we have a separate information page [Deploy](./deploy.md).
10081

10182
### JavaScript Usage
10283

docs/core/world-wide.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,2 @@
1-
GraphHopper is able to handle coverage for the whole [Openstreetmap road network](http://planet.osm.org/).
2-
It needs approximately 22GB RAM for the import (CAR only) and ~1 hour (plus ~5h for contraction).
3-
If you can accept slower import times this can be reduced to 14GB RAM - you'll need to set osmreader.dataaccess=MMAP
4-
5-
Then, to run the web service with this world wide graph 'only' 15GB are necessary. Without contraction hierarchy
6-
this would be about 9GB.
7-
8-
With CH the service is able to handle about 180 queries per second (from localhost to localhost this was 300qps).
9-
Measured for CAR routing, real world requests, at least 100km long, on a linux machine with 8 cores and 32GB,
10-
java 1.7.0_25, jetty 8.1.10 via custom QueryTorture class (10 worker threads).
11-
12-
## JVM
13-
14-
If GC pauses are too long try `-XX:+UseG1GC`
15-
16-
## Elevation Data
17-
18-
If you want to use elevation data you need to increase the allowed number of open files. Under linux this works as follows:
19-
20-
* sudo vi /etc/security/limits.conf
21-
* add: `* - nofile 100000`
22-
which means set hard and soft limit of "number of open files" for all users to 100K
23-
* sudo vi /etc/sysctl.conf
24-
* add: `fs.file-max = 90000`
25-
* reboot now (or sudo sysctl -p; and re-login)
26-
* afterwards `ulimit -Hn` and `ulimit -Sn` should give you 100000
27-
28-
29-
## TODOs
30-
31-
* Try out to disable NUMA -> http://engineering.linkedin.com/performance/optimizing-linux-memory-management-low-latency-high-throughput-databases
1+
This file is outdated. Please goto:
2+
[Deploy](./deploy.md)

docs/web/quickstart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The following steps are simpler and only need the JRE, a jar file and an OSM fil
88
3. Start GraphHopper Maps via: `java -jar *.jar jetty.resourcebase=webapp config=config-example.properties osmreader.osm=berlin-latest.osm.pbf`
99
4. After you see 'Started server at HTTP 8989' go to [http://localhost:8989/](http://localhost:8989/) and you should see a map of Berlin. You should be able to click on the map and a route appears.
1010

11+
To see how GraphHopper is configured for production usage, see the separate site [Deploy](./../core/deploy.md).
1112

1213
## Troubleshooting
1314

0 commit comments

Comments
 (0)