My question is similar to slow import via osm2pgsql to postgresql database and Optimizing osm2pgsql imports for OSM data but as we currently have quite some problems importing a large set of OSM data I open a new one.
What is the best way to import a large dataset (OSM Export of Europe) into a postgres DB?
Our computer has 32 GB of RAM... so it could use all of that.
We tried a couple of params, but had no success... last try we used the
osm2pgsql -c -S /usr/share/osm2pgsql/default.style --slim -d osm-europe -U postgres -C 25000 europe-latest.osm.pbf
But we ran out of memory even though our sever has 32 GB of RAM available.
pending_ways failed: out of memory for query result (7) Error occurred, cleaning up
How do we improve our import command?
Even if it takes longer... But we need to have the data imported into our postgres DB.
Would you recommend using an EC2 for the task or should our setup work with different parameters?