text: Q:
  
  TileServer PHP Performance - MBTiles vs "static files in a directory"
  
  I have OSM basemap tiles being served using Klokantech TileServer using WMTS. I have multiple users using them through ArcMAP. The performance is already way better than using the usual ArcGIS Online Basemaps, but sometimes it does stall or needs refreshed, which can be an annoyance. I was curious how much better of a performance it is to use the static files as opposed to the MBTiles themselves, considering the managing of the MBTiles is much easier. I was asking because the website for the Tileserver has this statement. 
  "Direct reading of .mbtiles files is supported, but with decreased performance compared to the static files in a directory. The advantage is easier data management, especially upload over FTP or similar protocols."
  This will also require me to figure out how to create the static tiles as I am not familiar with the methodology. 
  
  A:
  
  Great to hear you use our TileServer-PHP project: https://github.com/klokantech/tileserver-php/!
  The static files for map tiles (a folder with .png or .jpg files) are served directly by the web server - so no PHP is involved. Tiles from MBTiles are served by PHP, which opens SQLite archive, loads the relevant tile blob from it and returns it to visitor on demand. This means with map tiles in a folder there is no dynamic processing involved and you should gain the highest possible performance. MBTiles may be almost equally fast, but you have to ensure your PHP is configured well on the webserver, check how many simultaneous requests can the PHP process/module serve, how are set the PHP caches, etc.
  Typically, on a cheap webhosting which is not fine-tuned for high-performance PHP, the difference may be in an order of magnitude on the initial requests. Static files scales better as well (from the same hardware you may serve more simultaneous visitors).
  You may run tests on your own hosting with something like http://loader.io/ to see the real difference for your end users.
  TileServer-PHP project can serve maps from .MBTiles as well as folders, and these can be mixed. It means you can always upload MBTiles first, and if one of your maps is extremely popular you can instead reupload it as tiles in a folder and remove the relevant .mbtiles file - and serve from the same URL (so your visitors will not recognise you have switched - there is no difference for them in the link).
  MapTiler (http://www.maptiler.com) can generate the map tiles in both MBTiles format and folder-with-tiles format.
  If you want to "unpack" existing MBTiles file into a folder with tiles, then use the mbutil (https://github.com/mapbox/mbutil).
  
  