[mapserver-users] mapcache in a cluster

thomas bonfort thomas.bonfort at gmail.com
Thu Oct 20 04:48:40 EDT 2011


Travis,
I haven't had any feedback from people using mapcache in a cluster.
This is my understanding of the possibilities and pitfalls:

- if you have a fully seeded cache, there are no locking issues,
therefore running a mapcache cluster will be transparent.
- if you have a non-seeded cache, there are some potential pitfalls:
  - mapcache does not lock the tiles directly as tilecache does, it
instead locks a "resource" corresponding to the metatile that is being
created.
  - This resource is a file placed in the <lock_dir> directory. If you
configure the lock directory to be a shared network mounted directory,
then the multiple mapcache instances /should/ manage to synchronize
between one another.
  - There is a mutex protecting the aquisition of the lock file, which
of course is of no use if you have a cluster of mapcache instances.
Depending on the capabilities of your network mounted filesystem, it
is not impossible that multiple instances manage to aquire a lock on
the same resource, which would potentially cause each instance to
request the metatile from the source wms. In the worst case scenario,
you would have N duplicate requests on the source, where N is the
number of mapcache instances. For reference, with tilecache, the usual
behavior (i.e. not worst case) is M of these duplicate requests, where
M is the number of tiles displayed in the browser window arriving on
an unseeded area.
 - I would consider it a bug if there are these N duplicate requests
in the case where the filesystem supports the atomic locking of a
file.

In conclusion, mapcache /should/ support the architecture you are
proposing, although as it is yet untested it is difficult to guarantee
that it will be bug free from day 1. Please post your experience back
to the list, and/or file bugs should they happen.

regards,
thomas

On Wed, Oct 19, 2011 at 16:02, Travis Kirstine <traviskirstine at gmail.com> wrote:
> Has anyone attempted to set mapcache up in a cluster, one large file
> server holding caches with several mapcache servers? A few years ago
> we tried to have TileCache in a cluster but had issues with tile
> locking.
>
> Regards
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


More information about the mapserver-users mailing list