This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How much RAM does osm2pgsql required in case the progress won’t be killed? (full planet import)

0

I have 20GB RAM and I have allocated 22GB swap to cater for the planet.osm data. My shell command on the Ubuntu14.04 like this osm2pgsql -dosmgis -s -S"./default.style" -C16384 -Uwww-data -W -Hlocalhost -v ~/planet-140625.osm.bz2 the import time is too long with the speed (nodes=88k/s ways=0.15k/s,rels=11.2/s) and the nodes,ways and rels have been read in for about 1 week

but when the process move to "Committing transaction for planet_osm_point" it show "There is no transaction in progress" after I check the "dmesg" it shows "Out of memory kill osm2pgsql" so what I can do to deal with this proble? someone can give me some advices? with many thanks!!!

asked 07 Dec '14, 04:46

studiousdavid's gravatar image

studiousdavid
1222
accept rate: 0%

edited 07 Dec '14, 10:52

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866

Hi why do you ask the same related question after one hour again ? Duplicated questions tend to be closed without answering !

(07 Dec '14, 11:47) Hendrikklaas

@Hendrikklaas It's a different question

(07 Dec '14, 11:52) SomeoneElse ♦

2 Answers:

3

I just ran an import and on first try ran in to similar problems (and I have a lot of imports under my belt), but that is normal, OSM data continues to grow at a rapid pace and the tools are evolving too.

First you should be setting -C to 25000, then you will need to allocate more swap. On my machine with 32GB RAB it peaked at 24GB, I would aim for a total of 40-50GB swap to be on the safe side.

Note: if you are using a current osm2pgsql you shoud likely not use multiple processes if you are using the persistent node cache.

answered 09 Dec '14, 00:22

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 09 Dec '14, 00:24

Thank you for sharing your expriences!

(09 Dec '14, 00:39) studiousdavid

0

Hi studiousdavid, welcome, you might or please read this https://help.openstreetmap.org/questions/12318/why-is-my-import-of-planet-latestosm-killed and other import related questions. Just by adding import or osm2pgsql into the blank line above.

answered 07 Dec '14, 11:42

Hendrikklaas's gravatar image

Hendrikklaas
9.3k207238387
accept rate: 5%

Thank you Hendrikklaas! I have read some of the FQA but I'm still a little bit confused

(09 Dec '14, 00:38) studiousdavid

Source code available on GitHub .