-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#936 causes postgres to run out of memory #938
Comments
Hello, @TomPohys I'm using quickstart.sh. (sorry if this is too much detail, but it calls "make db-start-preloaded" which uses the "postgres" service in the "docker-compose.yml" file. That starts the "openmaptiles/postgis-preloaded:5.2" docker image, which has a default postgres configuration). So, any questions you have about the configuration of my postgres can be found in the openmaptiles/postgis-preloaded:5.2 image. I asked postgres for its configuration though, using this: And it replied with this:
It seems like maybe you want me to change the postgis or postgis-preloaded section of https://github.com/openmaptiles/openmaptiles-tools repo to tune the postgres server differently? Is that true? I'm fine doing that, but I want to be sure that's what you think I should do. To reiterate, the current config works on every commit up until the most recent one ( #936 ). 6ac544f works just fine. |
I saw the following error message in the logs which might be the same problem:
|
Hi @arichnad, I am sorry for the late answer. Could you please try to do it manually? Like from readme by step-by-step import and generating? There is not used postgis-preloaded. The PostgreSQL configuration can be changed in pgdata/postgres.conf (can by done by ALTER SYSTEM). And you do not need to change openmaptiles-tools repo. Thanks |
@TomPohys Yes, thank you for your reply.
No, on a second try, it is still failing. I just ran:
Should we describe this in the documentation then? I'm confused if this is something only I need to do. I've been using openmaptiles for years, and only now I've needed to do this. To be clear, before c86f4a5 this wasn't a problem. |
Hi @arichnad, the PostgreSQL configuration is mostly OK with default values. It is very strange that PostgreSQL is |
I just got hit by this after it spending 5 days building a materialized view (it only used 1 core) ERROR: invalid memory alloc request size 1454083140 |
@TomPohys what regions did you test against? Did you do the planet? Or certain continents? I will test against whatever you've tested against. @pka @StephenAtty I'm not sure I've seen the "invalid memory alloc". Where do you see this? docker logs? output from quickstart? Thanks! @StephenAtty can you test the old version? 6ac544f? Thanks. |
@pka same to me. |
@arichnad - its in the docker logs. I'll try that version but it will be a few days until I can tell you if the problem has gone away due to the length of time the materialized view takes to build. |
Hi @arichnad, it was tested on the Czech Republic and Switzerland. And it was passing Github Actions testing. |
Same issue for me when trying to generate France. Postgres gets killed. Using 16 cores and 32gb of ram. |
Thanks @arichnad, switching to old version 6ac544fc9610b5 resolve the problem. |
@TomPohys @daliborjanak I've tested with "czech-republic" and "switzerland". They do not fail on your commit. ( Can you test master against "north-america" or planet? I think they will fail for you. Based on what @Duiesel and I are reporting above, 6ac544f doesn't have this problem with larger areas. @rakzcs Thanks. Can you test against the old version? 6ac544f? Thanks. |
This is what i get when trying to generate france |
@arichnad After returning from holidays, I can report that my Europe import finished successfully (after 10 days...) with 6ac544f. I also tested Switzerland first (what else?), which finishes with #936 without problems. I can't remember where I saw the error message, probably in the PostgreSQL container output. |
@TomPohys or @daliborjanak Can you test master against "north-america" or "europe" or planet? I think they will fail for you. Based on what @Duiesel @pka and I are reporting above, 6ac544f doesn't have this problem with these larger areas. |
Hi @arichnad, I test building aggregation on France too. There is a problem with RAM consuming of this building aggregation. For the Czech Republic or Switzerland is 32GB OK. For France, I have to extend swapfile to 64GB. During There has to be a way how to optimize RAM consuming for building aggregation on zoom 13. I am thinking about some area splitting or something like that. |
Europe generated to level 14 in just under 9 days under 6ac544f |
@arichnad yes, like this makina-maps@6327477 |
Hi @arichnad. If you do not want buildings on zoom level 13, you can delete lines 84 - 96 in after this change, you need to run again If you still want building on zoom level 13, you can uncomment |
buildings at zoom level 13 were going through a new "optimization" step that was crashing. New optimization step described here: openmaptiles#936 Bugs about optimization failures: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
@TomPohys I noticed you closed this ticket. I still get postgres crashing on large datasets (North America, Planet, Europe, etc). I'm very happy I have your temporary work-around, but I'm not sure that's a long-term solution. If the new goal is to require 96gb of memory (64 swap + 32) for "Planet", then I'm fine with that, but I'm not sure Planet has been tested with 96gb, has it? Thoughts? Thanks. |
Hi @arichnad, I closed it because I thought, that this issue was solved (the We can open a new issue Is it OK? |
Your new issue #974 is fine. I'll close this. Thanks! |
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
FWIW, I ran into this exact same memory issue while processing the Europe dataset (md5 c5d996b967d0af078af2e5817e1d43c8) from geofabrik.
....and I was running on system with 256GB of RAM. I tested using a cfc243e and 7216593 etc... I tried the suggested workaround here https://github.com/openmaptiles/openmaptiles/blob/master/layers/building/building.sql#L84-L96 and I got this error:
I reverted to 6ac544f and was able to complete a successful import. |
@shermanw you might want to mention it on the new ticket (974) as well, as they are discussing how to fix 936 there. |
Hi @shermanw, maybe I miss one step and that is comment out a line https://github.com/openmaptiles/openmaptiles/blob/master/layers/building/building.yaml#L23. There is CREATE MATERIALIZED VIEW osm_building_block_gen1 AS
SELECT *
FROM osm_building_block_gen1(); which rise an error |
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
buildings at zoom level 13 were going through a new optimization step that was crashing (running out of memory I think). New optimization step described here: openmaptiles#936 Bugs about optimization here: openmaptiles#938 openmaptiles#937
@TomPohys @daliborjanak
Most recent commit ( c86f4a5, #936 ) causes postgres to run out of memory and terminate.
my .env has this at the end.
ran
./quickstart.sh north-america
postgres docker log says this:
I have 32gb of ram on this machine.
from quickstart:
If I run the same thing with the previous commit ( 6ac544f ), I do not get this error.
Please let me know if there's something I am doing wrong. I can test again with a different .env file if you would like.
The text was updated successfully, but these errors were encountered: