I'm currently importing the planet-latest.osm.pbf file I downloaded from ftp://ftp.spline.de/pub/openstreetmap/pbf/planet-latest.osm.pbf some time last week. I'm importing it using the following command:
nohup osm2pgsql -l -U gis -c -v -r pbf --unlogged --drop -s data/planet-latest.osm.pbf &
My problem is that the ways are importing very slowly and based on current speed (0.04k/s) and the OSM stats it will take 86 days to import them all. By contrast the nodes imported at 151.3k/s. Even if I waited 86 days for the ways to import (I won't) I would then need to import the relations and sit through all the post-processing.
I recently imported another planet file in .osm
format using the same command line arguments and, although it ultimately failed due to a parsing error it was moving along at a much faster speed.
From what I can see in the docs I've done everything I can to improve the import speed.
Can anyone tell me why the .pbf format import is moving so much slower over ways than the .osm format?
I'm using PostGIS 9.4 and osm2pgsql 0.88.1. Disks are on a fast SAN, the machine has a single Intel Xeon @ CPU 2.67GHz and 4GB memory. OS is Ubuntu 14.04 Server.
--cache
or-C
option). You don't have much memory, which is bad for planet import, but maybe try-C 2000
.--cache 200
and it does ok. This server has SSDs and I have given it considerable SWAP to maintain stability. Hopefully a downgrade of osm2pgsql helps.