MapServer / mapcache

MapCache source code directory. Please submit pull requests to the 'main' branch.
https://mapserver.org/mapcache
Other
137 stars 96 forks source link

Artefacts on tiles when using apache module #291

Open FoxAndOps opened 2 years ago

FoxAndOps commented 2 years ago

We are experiencing some strange artifacts on tiles when using the mapcache apache module, but not when using fcgi.

mapcache_artefacts

Sources are wmts services. I have been testing in docker containers using the exact same versions of dependencies (including Gdal 3.5.1 - as it is used for wmts sources) and Mapcache (1.12.1). Deleting the affected tiles and redownloading them or waiting for tile expiration fixes this issue.

We have been running mapcache in production through fcgi for quite some time now and I am 100% sure artifacts do not happen. We switched to fcgi because of this issue.

Any idea what could be causing these artifacts, and why it only happens with apache module ?

sdlime commented 2 years ago

This might be a good question for the mailing lists to start - more eyes. I've been running MapCache using the Apache module for years and have never seen anything like it.

marisn commented 1 year ago

What kind of backend are you using? Do you pre-seed your tiles or are they cached on-the-fly?

FoxAndOps commented 1 year ago

Tiles are stored on disk, and cached on-the-fly.

sdlime commented 1 year ago

Wonder if the MapCache 1.14.0 makes a difference?

FoxAndOps commented 1 year ago

Wonder if the MapCache 1.14.0 makes a difference?

Sadly, it doesn't. I just updated Mapcache to 1.14.0 & Gdal to 3.6.2 but artefacts still appear when using the mapcache module.

sdlime commented 1 year ago

Can you isolate the WMS call that creates the image that mapcache carves into tiles? Would be good to verify the artifacts aren't in the source material.

marisn commented 1 year ago

If you are certain your WMTS source is OK, I would suggest to give LMDB a try. Although it will not shine any light on the root of problem, it is a workaround to try. When MapCache runs as a module, complexity of debugging increases immensely as bugs might be timing-sensitive due to access patterns of shared resources among threads. I had frequent corruptions with on-fly BDB cache under load and sunk a lot of hours trying to figure out what was causing it without a success. Finally I implemented LMDB cache and for a few months haven't had a single problem. YMMV

FoxAndOps commented 1 year ago

@marisn : I tried LMDB as you suggested, and so far so good ! A huge thank you to you !