[Geoserver-users] excessive tile requests

Hello,

I have a global base layer derived from a shape file (VMap0).
I add a coverage image layer that covers a small part of the base layer.
I view them both through OpenLayers.

If I view both layers at, or near, the maximum zoom extent, then the
response from the server is very quick - the whole map can be rendered in
3-4 tiles so the server only has to send 3-4 tiles.

However, if I zoom-in to a small portion of the coverage, the response from
the server is very slow. Many (20-30) tiles are returned from the server
even though only 3-4 are actually visible to the user.

It's as if the server is returning the whole map at the zoomed-in scale
rather than just the portion visible to the user.

I understand that the server returns a 'halo' of tiles around the visible
area, and the above situation would be acceptable, if no more tiles were
returned when I pan the map at a constant zoom level. But that doesn't
happen. If I pan, another 20-30 tiles are downloaded.

It it possible to reduce the halo size so that only visible tiles are
requested and returned from the server?

I appreciate that this may be an OpenLayers issue rather than a GeoServer
issue.

Thanks for any help,
Dave

--
View this message in context: http://www.nabble.com/excessive-tile-requests-tp20299515p20299515.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

djud ha scritto:

Hello,

I have a global base layer derived from a shape file (VMap0).
I add a coverage image layer that covers a small part of the base layer.
I view them both through OpenLayers.

If I view both layers at, or near, the maximum zoom extent, then the
response from the server is very quick - the whole map can be rendered in
3-4 tiles so the server only has to send 3-4 tiles.

However, if I zoom-in to a small portion of the coverage, the response from
the server is very slow. Many (20-30) tiles are returned from the server
even though only 3-4 are actually visible to the user.

It's as if the server is returning the whole map at the zoomed-in scale
rather than just the portion visible to the user.

I understand that the server returns a 'halo' of tiles around the visible
area, and the above situation would be acceptable, if no more tiles were
returned when I pan the map at a constant zoom level. But that doesn't
happen. If I pan, another 20-30 tiles are downloaded.

It it possible to reduce the halo size so that only visible tiles are
requested and returned from the server?

I appreciate that this may be an OpenLayers issue rather than a GeoServer
issue.

Indeed it is, there is a configuration option in OpenLayers that controls how many tiles are loaded besides the visible ones,
it's called buffer. I don't know what the default value is, but
in the GeoServer preview we set it to 0, like this:

tiled = new OpenLayers.Layer.WMS(
                     "sf:archsites - Tiled", "http://geo.openplans.org:8080/geoserver/wms",
                     {
                         width: '800',
                         srs: 'EPSG:26713',
                         layers: 'sf:archsites',
                         height: '500',
                         styles: '',
                         format: format,
                     },
                     {buffer: 0}
                 );

Ah, if your tiles are not changing often, a better solution
is to use a tile caching solution such as GeoWebCache, with that
you can leave the usual buffer and have massive performance
benefits (10-100 times faster tile serving).
Leave GeoServer serve directly only the dynamic layers (e.g.,
those that do change on a daily basis, or that are dynamically
filterable by the user, and so on).

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Thanks Andrea,

I do already use buffer: 0, for all my layers, but OpenLayers/GeoServer
still insists on downloading many extra tiles.

Dave

Andrea Aime-4 wrote:

djud ha scritto:

Hello,

I have a global base layer derived from a shape file (VMap0).
I add a coverage image layer that covers a small part of the base layer.
I view them both through OpenLayers.

If I view both layers at, or near, the maximum zoom extent, then the
response from the server is very quick - the whole map can be rendered in
3-4 tiles so the server only has to send 3-4 tiles.

However, if I zoom-in to a small portion of the coverage, the response
from
the server is very slow. Many (20-30) tiles are returned from the server
even though only 3-4 are actually visible to the user.

It's as if the server is returning the whole map at the zoomed-in scale
rather than just the portion visible to the user.

I understand that the server returns a 'halo' of tiles around the visible
area, and the above situation would be acceptable, if no more tiles were
returned when I pan the map at a constant zoom level. But that doesn't
happen. If I pan, another 20-30 tiles are downloaded.

It it possible to reduce the halo size so that only visible tiles are
requested and returned from the server?

I appreciate that this may be an OpenLayers issue rather than a GeoServer
issue.

Indeed it is, there is a configuration option in OpenLayers that
controls how many tiles are loaded besides the visible ones,
it's called buffer. I don't know what the default value is, but
in the GeoServer preview we set it to 0, like this:

tiled = new OpenLayers.Layer.WMS(
                     "sf:archsites - Tiled",
"http://geo.openplans.org:8080/geoserver/wms",
                     {
                         width: '800',
                         srs: 'EPSG:26713',
                         layers: 'sf:archsites',
                         height: '500',
                         styles: '',
                         format: format,
                     },
                     {buffer: 0}
                 );

Ah, if your tiles are not changing often, a better solution
is to use a tile caching solution such as GeoWebCache, with that
you can leave the usual buffer and have massive performance
benefits (10-100 times faster tile serving).
Leave GeoServer serve directly only the dynamic layers (e.g.,
those that do change on a daily basis, or that are dynamically
filterable by the user, and so on).

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/excessive-tile-requests-tp20299515p20322442.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

I should probably persue this on an openlayers forum...but I've looked at
the OpenLayers code and I don't see 'buffer' used anywhere.
--
View this message in context: http://www.nabble.com/excessive-tile-requests-tp20299515p20323250.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

On Tue, Nov 4, 2008 at 3:24 PM, djud <djud@anonymised.com> wrote:

I should probably persue this on an openlayers forum...but I've looked at
the OpenLayers code and I don't see 'buffer' used anywhere.

The buffer property is defined in OpenLayers.Layer.Grid.

The reason why you see more tiles than you think there should be is
usually a map extent that is just a small bit larger than some tile
borders. This will cause the whole adjacent tile to be requested.

Regards,
Andreas.

--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

Dave,

On Tue, Nov 4, 2008 at 2:39 PM, djud <djud@anonymised.com> wrote:

I do already use buffer: 0, for all my layers, but OpenLayers/GeoServer
still insists on downloading many extra tiles.

Be aware that OpenLayers.Layer.WMS takes 4 arguments. A common mistake
is to put options in the request options hash (the 3rd argument)
instead of the layer options hash (the 4th argument):

... new OpenLayers.Layer.WMS("name", "url", {layers: "yourlayer"}, {buffer: 0});

Also, the reason why loading the initial view feels faster is most
likely that the required tiles are already in the browser cache.

Regards,
Andreas.

--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

Thanks for the replies Andreas. I agree with all your points; I do indeed see
more tiles than expected because of the map being slightly larger than the
tile borders, I see the buffer property, yes it is easy to put it in the
wrong parameter object and browser cache is significant.

Also, I've tweaked the Tomcat memory parameters and this has significantly
improved performance.

Thanks for your help,
Dave

--
View this message in context: http://www.nabble.com/excessive-tile-requests-tp20299515p20338220.html
Sent from the GeoServer - User mailing list archive at Nabble.com.