[ka-Map-users] Performance problems

Paul Spencer pspencer at dmsolutions.ca
Mon Feb 5 09:15:24 EST 2007


right, sorry I missed that detail.  The only options you have are:

1) live with it (not good)
2) modify redraw so that it will accept variable substitution - the  
code is already in the no-cache case so redraw shouldn't be hard to add
3) change your app so you don't need to use variable substitution -  
may not be possible
4) fix the no-cache implementation so it doesn't cause a full  
metatile draw for every tile

Cheers

Paul

On 5-Feb-07, at 8:42 AM, Pje wrote:

> Hmm. But if I set tile_source to redraw I will can't use variable  
> substitution, right? Because variable substitution is only  
> implemented in tile_nocache.php
>
> On 2/5/07, Paul Spencer <pspencer at dmsolutions.ca> wrote: Pje,
>
> using no-cache is a "BAD THING" (tm).  It causes the whole metatile
> to redraw for every tile request.  This is absolutely the worst case
> performance.
>
> What you really want to do is use is something like:
>
> "tile_source" "redraw"
> "redraw_interval" "150"
> "refresh_interval" "300"
>
> This will cause the client to automatically re-request tiles every
> 300 seconds (5 minutes) and the tiles will be considered stale and be
> recreated every 150 seconds (2.5 minutes).
>
> This allows the tiles to be cached for 2.5 minutes so when a client
> loads a tile, it only causes one map draw per metatile rather than a
> map draw per tile.  The tiles are time-stamped and when a request
> comes in for a tile that is past the time allowed, it redraws the
> cached tiles.  The timestamp is done per-layer so that all the tiles
> are synchronized.
>
> The refresh interval ensures that the layer is dynamically updated
> even if the user does nothing.
>
> You can play with the times to get the desired effect and balance
> your load, but you should find that this produces substantially
> better results for you.
>
> Cheers
>
> Paul
>
> On 5-Feb-07, at 7:53 AM, Pje wrote:
>
> > Hi,
> >
> > I am having some problems with two layers that use tile_source
> > "nocache".
> >
> > I am using it because these layers are respectively points sent by
> > fishing vessels and areas. These points are sent at 5min intervals
> > and the areas are inserted by the user. So, *i think* i can't use
> > cache in this case.
> >
> > The problem is that the map is taking too much time to load. The
> > points table in the database have 18.000 registers... and there
> > will be a lot more. And there is about 18 areas.
> >
> > Also, I am using variable substitution in mapfile. My points layer
> > is something like that:
> >
> > layer
> >     name "track"
> >     group "Track"
> >     connectiontype POSTGIS
> >     connection "dbname=xxx user=xxx password=xxx host=xxx port=5432"
> >     data "%data%"
> >     type line
> >     status on
> >     metadata
> >         tile_source "nocache"
> >     end
> >     class
> >         name "track"
> >         color 0 0 0
> >     end
> > end
> >
> >
> > When the user select some vessel, I do that using javascript:
> >
> > var map = myKaMap.getCurrentMap();
> > var track = mapa.getLayer('track');
> > track.replacementVariables = {vessel: id_vessel};
> > track.redraw();
> >
> > The areas layer is using the same logic.
> >
> > So, there is a way to achieve that but with better perfomance? The
> > performance was ok before I add these two layers. Any tips?
> > _______________________________________________
> > ka-Map-users mailing list
> > ka-Map-users at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/ka-map-users
>
> +-----------------------------------------------------------------+
> |Paul Spencer                          pspencer at dmsolutions.ca    |
> +-----------------------------------------------------------------+
> |Chief Technology Officer                                         |
> |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
> +-----------------------------------------------------------------+
>
>
>
>
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users

+-----------------------------------------------------------------+
|Paul Spencer                          pspencer at dmsolutions.ca    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+






More information about the ka-Map-users mailing list