I'd like to use OpenMapTile server with leaflet in my webapp. OpenMapTile server stands on ec2 on AWS. I have also my webapp, that uses leaflet to present data. I'm serving XYZ png tiles in couple of color styles. What I have noticed is, that serving data from own hosted server is much slower then hosting it from services like MaptilerCloud. When I first load map in a particular style, it takes even up to 20 seconds for a full load. Later, searching for another city in a given style is much faster by the way. When I'm pasting a single url to my browser, to fetch a single map-tile from my own server, it loads immediately. Do you know, what can be a problem? Ec2 has CPU usage below 15%, with max 10Gbps network burst bandwidth...
Asked
Active
Viewed 314 times
0
-
1Do you have all map layers generated? If it is a fresh server instance, then each change of zoom in / out or shift must be generated appropriate area in the form of raster graphics. – Grzegorz T. Sep 14 '20 at 15:54
-
I have set up a server using docker, simply running docker run --rm -it -v $(pwd):/data -p 8080:80 klokantech/openmaptiles-server Then I have downloaded the raw date of whole planet. In the next step, I added couple of additional, custom color styles. After that, server was ready to use, providing xyz urls, that can be used with leaflet. Should I do anything more in order to have all layers generated? – Wons Sep 14 '20 at 18:34
-
I was working on a project that ran on 4 servers, a huge amount of RAM and SSD drives in RAID and the servers were crashing, traffic up to 300,000. users per day. So a script was written that generated 6 layers of country and it took about two weeks, so the whole world ... :) – Grzegorz T. Sep 14 '20 at 19:17
-
Ok, thank you. But I’m wondering: how pages like mapiful.com achieve such powerful performance? https://www.mapiful.com/editor/#!/location/ – Wons Sep 15 '20 at 04:56
-
Maps are nothing but raster pictures. They have to generate once. It's not that they generate every time someone uses the map. That's why it works slowly at the beginning, because each map shift, including zooming in and out, also generates the map. – Grzegorz T. Sep 15 '20 at 08:28
-
Ok, I have another interesting observation, that maybe you can explain somehow . When traffic goes over http, from web app directly to ec2, loading map is waaay faster. When I add load balancer before ec2 and route traffic over https to the instance, loading time is like 3x longer. Is it possible, that map caching doesn’t work with https? Or maybe load balancer in thre middle is the problem? – Wons Sep 16 '20 at 04:29
-
Unfortunately, I have never dealt with AWS, so I won't tell you anything, but the load balancer shouldn't have such a big impact, it should be practically transparent. – Grzegorz T. Sep 16 '20 at 13:27