Own OSM server - osm2pgsql - import speed


I’m new in OSM world with just few days of experience in buliding own OSM server on the VPS.

Importing Slovakia took just 845s overall …

The I run: osm2pgsql --append --slim -d gis --hstore --multi-geometry --number-processes 2 --tag-transform-script /home/osm/openstreetmap-carto/openstreetmap-carto.lua --style /home/osm/openstreetmap-carto/openstreetmap-carto.style -C 500 /home/osm/poland-latest.osm.pbf

It crashed after few hours asking for more memory so now from 48 hours I have it running with -C 1500 option.

Problem is that it already runs 48 hours just with the message:
Reading in file: /home/osm/poland-latest.osm.pbf
Using PBF parser.

so I do not know what is the progress :frowning: - and even I could think that it hangs but based on 70% CPU utilisation I assume that its doimf something

Please advise:

  • How can I at least roughly tell how much is done?
  • Does it make sense to cancel it and start with flat-nodes option?
  • For future import of another countries can you recommend any other options to speed it up and better monitor the progress?

Thnak you very much in advance for any replies.

It’s generally not a good idea to use the append option to try & add different country extracts at different times. There are multiple reasons for this, but the simplest one is that append is designed solely for updating the same area.

The best approach is to merge the two pbfs using osmosis or osmconvert and import them as a single file. A more involved one is to change the name of the target tables and build planet_osm_* as views on top of them. I’ve tried this and it works reasonably well, but requires some SQL & PostgreSQL knowledge.