<p></p>
<p>I found a possible culprit. See PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="842592766" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/osm2pgsql/issues/1438" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/osm2pgsql/pull/1438/hovercard" href="https://github.com/openstreetmap/osm2pgsql/pull/1438">#1438</a>. This speeds up import in my test from 10 hours to 7.5 hours!</p>
<p>You should also try setting the cache to 0. In your case half the memory is going to the cache and it will not be available for the Linux buffer cache which will slow down processing.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/issues/1436#issuecomment-808795835">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353WS5ECSC676N7FSLPLTFY3XFANCNFSM4ZZHGTSQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353WJJHT7SGF6UG3TXYTTFY3XFA5CNFSM4ZZHGTS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGA2T5OY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/issues/1436#issuecomment-808795835",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/1436#issuecomment-808795835",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>