Replies: 6 comments 9 replies
-
First, see this FAQ entry. Second: Parallelization isn't some magic thing that you just switch on and then everything is fast. Osm2pgsql is a complex piece of software and there are many things developers are doing in the limited time they have to make it faster and make it better. There are many places where it can be made faster (some of which involve parallelization), but that's not always the highest priority. And please remember you are getting this software for free. I get that you are frustrated that osm2pgsql isn't as fast or as good as you would want it to be. But imagine how frustrated developers are if you basically tell them that they are stupid and don't know what they are doing. Your question isn't a question at all, it is a complaint. And that is not the best way to motivate developers to work for you for free. |
Beta Was this translation helpful? Give feedback.
-
@joto thanks for the explanations! I'm sorry if I pissed you or anyone else off ! I haven't wrote this post to blame anyone. I am just trying to understant what can make this process so slow, and make it better by offering some ideas. I very much respect and appreciate the work done by the developers behind this project. But keep in mind, as everywhere in a healthy society, you can not get only good feedback, no matter how much you will try. The alternative will be to move to a country like North Korea and from inside, there, everything will be rosy, at least on TV. To get back to the topic of this discussion, I'm not sure how osm2pgsql prioritizes the issues, but maybe for the next year, instead of implementing 10 new features that maybe 0.1% of users will end up using, better invest that time in fixing this, or any other performance issue that is known by the team. The faster and less resource demanding these processes are, the more accessible they will become, especcialy to the small folks, thus increasing the pool of people that could end up working on this project. As right now, a lot of those people will probably give up and move towards paying a 3rd party entity to deal with the maps services. Sorry again if something will sound offensive! I'm just rying to be constructive here! Thanks |
Beta Was this translation helpful? Give feedback.
-
Apart from possible other reasons within osm2pgsql, I strongly recommend you to go with at least a Xeon E5 v4 processor that supports PCIe 3.0 if you want to be on a budget second hand server instead of v2, and get off SATA for your disks. Disk IO is probably one of the main bottlenecks in such import processes. I import the entire Planet using a complex flex style in about 8 hours on my 2016 age HP Z840, using regular PCIe NVMe disks and a cheap PCIe 3.0 NVMe card with bifurcation set in the system's BIOS. Runs highly reliable. Sure, the switch to NVMe will not suddenly make your system go 100% on CPU and IO all the time, but it does help with IO bottlenecks. |
Beta Was this translation helpful? Give feedback.
-
The random IO needed by osm2pgsql is not so much about maximum throughput, but more about latency and IOPS, where NVMe wins over SATA, e.g see below link for an explanation: https://www.techtarget.com/searchstorage/feature/NVMe-SSD-speeds-explained I also don't see anywhere near maximum throughput in GBs of my NVMe drives when osm2pgsql runs, but it still is a lot faster due to high random read/write. This is more general an issue with databases, they often need good low queue depth random read/write, which even with NVMe is much lower than the GBs/s maximum sequential read/write. E.g. even my raided NVMe Samsung drives have only about 42 MB/s random read at queue depth 1 and with 1 thread (Q1T1), and 78 MB/s random write. This ameliorates much with higher queue depth and more threads: e.g. 1774 MB/s random read and 1390 MB/s random write at Q32T16. That is however still far below the maximum 11GB/s sequential read/write of the same drives as measured in CrystalDiskMark at Q8T1. |
Beta Was this translation helpful? Give feedback.
-
Is not a disk problem. If you look at the benchmark for Planet (PBF) on Ubuntu 20.04, Xeon E3-1245 v2, 32GB + 72GB swap, 4C/8T, 2x 480GB SSD RAID 0 ~25h which is a similar system with what I have, except for th RAID 0 ( so better HDD performance) and the CPU. But the speeds reported there are about 30% higher than what I see on my side. On my side i have 2 x XEON E5-2630 v2. The 1 thread score difference between my CPU and E3-1245 v2 is roughly 30%, where E3-1245 v2 is the fastest. So you see, it is strictly related to the single core CPU performance. E3-1245 v2: 2 x XEON E5-2630 v2: |
Beta Was this translation helpful? Give feedback.
-
I don't see an issue here. I did a You haven't provided enough information to show what the bottleneck is, but it's almost certainly the disks, regardless of what you've said. Disk measurements in MB/s are not useful and indicate a misunderstanding of random IO workloads. A system running osm2pgsql will benefit from being able to use lots of RAM. This RAM is not directly used by osm2pgsql, but is used by the OS to cache. You also haven't indicated how you adjusted your PostgreSQL settings. This can make a significant difference in performance in the postprocessing stage. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm new to osm2pgsql realm, but still it is impossible not to notice how slow the tool is when trying to import the whole worls map.
Monitoring the hardware resources, the only resource that seems to be utilized at maximum is the RAM. The rest: CPU and Disks are berely used.
For example when the command below is started, I'm reading in the logs processing rates of:
Processing: Node(8646182k 1100.0k/s) Way(25045k 11.64k/s) Relation(0 0.0/s)
command executed:
sudo -u renderer osm2pgsql -d gis --create --slim -G --hstore --tag-transform- script /data/style/openstreetmap-carto.lua --number-processes 22 -S /data/style/ openstreetmap-carto.style /data/region.osm.pbf -C 8192 --flat-nodes /data/databa se/flat_nodes.bin
At these rates, there is no wonder it takes days to set up an openstreetmap system, if you don't own a last gen server.
My CPU load doesn't go beyond 7% and Disks IOs don't exceed 15 MB/s. Only the RAM is maxed out.
To me this looks like some improper use (or better say: no use of ) parallelization .
Any particular reason(s) why the resources are not utilized at their max pottential ?
Thanks!
PS: the system I'm running on is a 22 cores 120GB RAM VM running on a server with 2 x Xeon v2 (24 cores total) with 128GB of ram and 2 x 1TB SATA SSD in RAID 1.
There is only this particular VM running on this system
Beta Was this translation helpful? Give feedback.
All reactions