A couple of things here:
- Yes, processing usually speeds up quite a bit towards the end, but it shouldn’t be that slow on ways!
- Are you sure you’ve setup the “postgresql.conf” properly, so PostgreSQL can both benefit from parallel processing when processing the ways and relations, and has enough RAM for all spawned workers? You may actually still be seeing inefficient processing and high IO by PostgreSQL itself, if it doesn’t get enough work memory to do the job.
- You’ve set C25000. In my last - successful - attempt to import the whole of Europe (+/- 20GB PBF) on a 16GB RAM 4-Core i5, with PostgreSQL running in a Virtualbox instance with just 11,5 GB RAM assigned (but plenty - a few dozen GB - of Ubuntu swap space assigned on an SSD), I set a maximum cache size of just -C 1500, which didn’t really seem to slow down the processing. I guess on your 32GB RAM machine, setting it to something like -C 5000 should be fine, and at least make sure all other processes and PostgreSQL can use the rest of the RAM.
This post by Sarah Hoffman, one of the osm2pgsql maintainers, may be interesting for you, although I have not yet followed all of her advices there (specifically, setting “-C 10” did not seem to give any beneficial effect on processing speed the one time I tried, even seemed to slow it down if I remember it well, and I have also not yet followed “fsync off” and other settings in the same code block there, although these are likely beneficial):
https://github.com/openstreetmap/osm2pgsql/issues/883#issuecomment-443539333