<div style="display: flex; flex-wrap: wrap; white-space: pre-wrap; align-items: center; "><img height="20" width="20" style="border-radius:50%; margin-right: 4px;" decoding="async" src="https://avatars.githubusercontent.com/u/3827156?s=20&v=4" /><strong>mahmoudhanafy</strong> created an issue <a href="https://github.com/openstreetmap/openstreetmap-website/issues/6057">(openstreetmap/openstreetmap-website#6057)</a></div>
<p dir="auto">Hi Team, Thanks for the great work you are doing. I'm completely new to ruby and to this project.</p>
<p dir="auto">I'm currently running a local version of osm-website, and I'm calling this endpoint:</p>
<pre class="notranslate"><code class="notranslate">https://myLocalWebsite/api/0.6/map?bbox=46.699791,24.6334425,46.7233944,24.6471732
</code></pre>
<p dir="auto">but it's taking too long in the rendering phase, I see the following line in logs:</p>
<pre class="notranslate"><code class="notranslate">Completed 200 OK in 25244ms (Views: 19820.2ms | ActiveRecord: 4122.8ms (26457 queries, 24031 cached) | GC: 1631.1ms)
</code></pre>
<p dir="auto">I see a lot of queries like this:</p>
<pre class="notranslate"><code class="notranslate">SELECT "changesets".* FROM "changesets" WHERE "changesets"."id" = $1 LIMIT $2
</code></pre>
<p dir="auto">So I have updated maps_controller to include changeset with nodes <a href="https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/api/maps_controller.rb#L31">here</a>, instead of loading it while rendering. it improved the performance but it's still taking around 11-12 seconds.</p>
<p dir="auto">When I'm trying the same request on the public website, it's taking less than 1 second (even without my change)</p>
<pre class="notranslate"><code class="notranslate">https://api.openstreetmap.org/api/0.6/map?bbox=46.699791,24.6334425,46.7233944,24.6471732
</code></pre>
<p dir="auto">So I'm wondering if there is any type of caching or multi-threading happening on the public website but not happening on my version.</p>
<p dir="auto">Thanks in advance,</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/6057">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMLKCFLPLPGJJJPKLT3AQAY3AVCNFSM6AAAAAB57CRV3GVHI2DSMVQWIX3LMV43ASLTON2WKOZTGA4TENZUGE2DQNI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLIG63UVBTNX5GOBHED3AQAY3A5CNFSM6AAAAAB57CRV3GWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHLQV35NU.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/6057</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/6057",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/6057",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>