<blockquote>
<p>I am doing a planet import on an EC2 instance with 16G of RAM. The machine is not doing any other work. I'm using --cache 8000 and these PG settings (mostly taken from pgtune):</p>
</blockquote>
<p>8000 is not even near enough RAM to store all nodes for the planet. Based on some tests with Europe I recently did, I estimate you need at least 48GB of RAM to store all nodes for planet in memory.</p>
<p>Unless you cannot afford SSD storage, I would thus strongly recommend to use the <strong>--flat-nodes</strong> option instead which stores the nodes on disk instead of in RAM, and drop the -C cache option of the osm2pgsql command line, and let osm2pgsql itself figure out its optimal processing settings. This is best done with SSD storage.</p>
<p>I managed to load Europe, which is about half planet, on a 12GB RAM Virtualbox instance, and I am currently re-running the same import with an even lower 8GB RAM setting for the VM. Since it already passed the node load stage (about 2 billion of them for Europe), I am pretty sure it will finish the import even with this reduced amount of RAM. As a consequence, I am also deeply convinced the same <strong>--flat-nodes</strong> and 8GB RAM setup will import planet fine, although I haven't tested this yet. However, if it can do Europe with such low RAM settings, I see no reason why it wouldn't be able to load planet, as it is just about 2-2.5 times bigger.</p>
<p>I actually see osm2pgsql defaulting to only 800MB cache when I start the command with --flat-nodes.</p>
<p>Of course, if you only have HDD storage and no SSD, trading the cost for more RAM (so probably the 48GB as I estimate) is probably the only way to get acceptable performance on your instance, as using --flat-nodes and storing all nodes on disk on HDD is likely very slow.</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/855#issuecomment-405849443">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AD2-7gQ6Z1oI5iS-20d9q0VBuKIRKRX_ks5uHu8cgaJpZM4VAAIJ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AD2-7gA96D52x6M1M05YH725YBCMNJ3Lks5uHu8cgaJpZM4VAAIJ.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/osm2pgsql","title":"openstreetmap/osm2pgsql","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/osm2pgsql"}},"updates":{"snippets":[{"icon":"PERSON","message":"@mboeringa in #855: \u003e I am doing a planet import on an EC2 instance with 16G of RAM. The machine is not doing any other work. I'm using --cache 8000 and these PG settings (mostly taken from pgtune):\r\n\r\n8000 is not even near enough RAM to store all nodes for the planet. Based on some tests with Europe I recently did, I estimate you need at least 48GB of RAM to store all nodes for planet in memory.\r\n\r\nUnless you cannot afford SSD storage, I would thus strongly recommend to use the **--flat-nodes** option instead which stores the nodes on disk instead of in RAM, and drop the -C cache option of the osm2pgsql command line, and let osm2pgsql itself figure out its optimal processing settings. This is best done with SSD storage.\r\n\r\nI managed to load Europe, which is about half planet, on a 12GB RAM Virtualbox instance, and I am currently re-running the same import with an even lower 8GB RAM setting for the VM. Since it already passed the node load stage (about 2 billion of them for Europe), I am pretty sure it will finish the import even with this reduced amount of RAM. As a consequence, I am also deeply convinced the same **--flat-nodes** and 8GB RAM setup will import planet fine, although I haven't tested this yet. However, if it can do Europe with such low RAM settings, I see no reason why it wouldn't be able to load planet, as it is just about 2-2.5 times bigger.\r\n\r\nI actually see osm2pgsql defaulting to only 800MB cache when I start the command with --flat-nodes.\r\n\r\nOf course, if you only have HDD storage and no SSD, trading the cost for more RAM (so probably the 48GB as I estimate) is probably the only way to get acceptable performance on your instance, as using --flat-nodes and storing all nodes on disk on HDD is likely very slow."}],"action":{"name":"View Issue","url":"https://github.com/openstreetmap/osm2pgsql/issues/855#issuecomment-405849443"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/issues/855#issuecomment-405849443",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/855#issuecomment-405849443",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [openstreetmap/osm2pgsql] Planet load fails with ERROR: relation \"osm_point\" does not exist (#855)",
"sections": [
{
"text": "",
"activityTitle": "**mboeringa**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@mboeringa",
"facts": [
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"openstreetmap/osm2pgsql\",\n\"issueId\": 855,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"openstreetmap/osm2pgsql\",\n\"issueId\": 855\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/osm2pgsql/issues/855#issuecomment-405849443"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 352322057\n}"
}
],
"themeColor": "26292E"
}
]</script>