Skip to content
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

Unnecessary flat-nodes with enough RAM #22

Closed
pnorman opened this issue Apr 30, 2013 · 8 comments
Closed

Unnecessary flat-nodes with enough RAM #22

pnorman opened this issue Apr 30, 2013 · 8 comments

Comments

@pnorman
Copy link
Collaborator

pnorman commented Apr 30, 2013

It's been said that you could almost use /dev/null for a flat-nodes file if you have a large enough -C value and don't plan to update the database. An option that allows you to use no file at all for flat nodes would be useful for when someone doesn't plan to update diffs and has enough memory. It would save on sequential writes and save on disk space. The latter is useful when using SSDs.

alex85k pushed a commit to alex85k/osm2pgsql that referenced this issue Oct 3, 2014
@lonvia
Copy link
Collaborator

lonvia commented May 30, 2015

How about literally allowing /dev/null instead of adding yet another option? Or would that be too obscure?

We'd have to disable ALLOW_LOSSY on the ram cache, so it fails if the cache is too small and chain get request right through. Not very difficult to do.

@pnorman
Copy link
Collaborator Author

pnorman commented Jan 6, 2017

#668 may fix this if it makes --cache unnecessary because it's a mmapped file

@pnorman
Copy link
Collaborator Author

pnorman commented Jan 30, 2017

@lonvia, did we ever test this? Perhaps there's a doc change needed.

@lonvia
Copy link
Collaborator

lonvia commented Feb 1, 2017

If you mean /dev/null, that does not work. If you mean the mmapped file, you probably still need the space on the disk but it might never be written to disk if there is enough memory and we delete it early. I can't test that on my setup at the moment.

@pnorman
Copy link
Collaborator Author

pnorman commented Feb 1, 2017

I was thinking of --slim --flat-nodes nodes.bin --cache 0, which then relies on OS caching for the mmapped file. But I guess there still is a use for a /dev/null equivalent

@lonvia
Copy link
Collaborator

lonvia commented Feb 1, 2017

The cache is more compact for extracts, so yes. Flat nodes on the other side cannot accidentally run out of memory.

@lonvia
Copy link
Collaborator

lonvia commented Feb 19, 2020

We should go about this in a different way: if --drop is given and no floatnode file, then osm2pgsql should only save the node locations in the DB that do not fit into the RAM cache. This has the same effect as requested in the original issue with the added bonus that it works even when the RAM cache is a little bit too small to keep all node locations.

@lonvia
Copy link
Collaborator

lonvia commented Nov 10, 2022

We now have a very efficient RAM middle, which allows to import the whole planet on a machine with 128GB RAM. That's what should be used on machines with enough RAM to import a non-updateable database.

Can we close this issue as not relevant anymore?

@pnorman pnorman closed this as completed Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants