Hi, I've imported France successfully and now I'm trying to import the full planet but can't get to the end of it. I've logged the output of osm2pgsql and seen a bad_alloc message:
And I also have some errors and fatals on the postgresql logs (EOF, terminating connection), but I supposed both are linked:
I was importing with the following command:
I have 32Gb of RAM, 8 cores, 1Gb of SWAP and 1Tb SSD (that's why I'm using flat-nodes). I've also tried with the -C option at 18000 (I've seen somewhere that beyond that value there was no difference). But I still have the issue. I really don't see how I could have a memory problem knowing that when I checked the usage during the import, I was around 20Gb of use max... I've seen this github issue where it is advised to increase swap size but it seems strange to me, isn't the swap supposed to be used then de RAM is full? Anyway this would be a last resort solution. Also a guy suggest to remove the -C option and that will let osm2pgsql use what it needs, so I'm trying that right now but it seems strange too because I've seen in that doc that the default value is 800 if the parameter is not written. I'm monitoring the usage of my server with this last solution just now, and the swap is almost full (960/1021MB), while the RAM is free (only 2Gb used on 32...). Does anybody have any idea of where this problem may come from? And what I should do to successfully import the whole planet? Thanks! asked 21 Sep '18, 16:26 voharunado |
Surprisingly enough software changes now and then and you shouldn't be assuming that tips given for older version still apply now. Current versions of osm2pgsql use a much more efficient caching algorithm and will not degrade as much as previous ones, which essentially required a cache large enough to keep all nodes in memory. In any case 1GB swap is not going to get you anywhere, 64 would be more like it (don't forget you have pgsql processes any lots of other stuff running during the import too), maybe even 128. answered 22 Sep '18, 08:24 SimonPoole ♦ Thanks for that advice, it still seems strange to me because I thought the RAM was used first, so with 32Gb of it, I assume I wouldn't need much swap. Anyway, I tried this weekend to remove de -C option (as advised in the github issue I linked) and the process terminated without the bad_alloc message. I still have an error but not related to memory, so if it works, I'll stay with that.
(24 Sep '18, 10:26)
voharunado
I successfully passed the processing step by removing the
(24 Sep '18, 15:19)
voharunado
I can now confirm that removing the -C option worked. However the full planet import took almost 3 days (244721s), but I just wanted it to work so it's fine for me.
(27 Sep '18, 16:08)
voharunado
|