<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I'm just beginning my usage of Open Railway Map - thank you so much :) As a thank you for all the hard work you do I donated 100 EUR as well.</div><div class=""><br class=""></div><div class="">I've successfully setup everything on my machine and I'm now trying to generate complete file-based maps[1] up to zoom level 15 for Sweden. I've written a "offline renderer" using the node-tileserver that accepts a rectangular range of co-ordinates (i.e only Sweden) and iteratively generates the tiles. Generating the 715 378 unique tiles (x4 for all bitmap variants and json) takes roughly a week using 8 cores and 52GB of ram. I'm guessing I'm doing something super inefficient. </div><div class=""><br class=""></div><div class="">- Machine: Google Cloud VM, 8 CPU with 52GB ram plus 200 GB of SSD disk</div><div class="">- Only loaded Europe, not entire planet.</div><div class="">- Postgresql:</div><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>- 12GB shared buffer</div><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>- 1.5GB work_mem</div><div class=""><span class="Apple-tab-span" style="white-space: pre;"> </span>- autovacuum = Off</div><div class=""><br class=""></div><div class="">The node worker is using Redis and Bull (<a href="https://github.com/OptimalBits/bull" class="">https://github.com/OptimalBits/bull</a>) and is multi-core. It's a fairly simple version[2] (see source code), but I'm lacking quite a bit understanding of which parts of node-tileserver I need to use so it's a bit of a hack. </div><div class=""><br class=""></div><div class="">My best guess is that it's the database queries that are slow I need to do additional tuning. Since the DB is only 6GB for Europe I'm thinking about moving Postgresql to ramdisk. </div><div class=""><br class=""></div><div class="">Any helpful pointers? I've looked into the Postgresql tuning guides (both general and PostGIS). So far I'm only getting a few tiles per second. </div><div class=""><br class=""></div><div class="">If you'r interested in the code itself it's available on <a href="https://gist.github.com/bivald/975e56a0850408255cbb6fc9e921df63" class="">https://gist.github.com/bivald/975e56a0850408255cbb6fc9e921df63</a></div><div class=""><br class=""></div><div class="">I'm fluent in JS and Python if that helps. </div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Niklas</div><div class=""><br class=""></div><div class="">[1] The reason is that since we only want to cover small parts of the world, the hosting for generated maps is so much simpler then hosting API:s and TileServers - not to mention faster. </div><div class="">[2] <a href="https://gist.github.com/bivald/975e56a0850408255cbb6fc9e921df63" class="">https://gist.github.com/bivald/975e56a0850408255cbb6fc9e921df63</a></div></body></html>