1

I am using OpenLayers to display a map and I have vectors layer with some features that I'm loading with AJAX from MySQL, and I'm using GeoServer to load all the background from shapefiles (like buildings, streets etc.) with default style, like this:

var generalLayers = new OpenLayers.Layer.WMS(
                "general", "http://XXX/geoserver/city/wms",
                { "transparent": "true",
                    LAYERS: 'city:Fence, city:Buildings, city:streets',
                    format: format,
                    tiled: true,
                    tilesOrigin: map.maxExtent.left + ',' + map.maxExtent.bottom
                },
                {
                    buffer: 0,
                    isBaseLayer: false,
                    displayOutsideMaxExtent: true,
                    yx: { 'EPSG:2039': false },
                    visibility: true
                }
            );

The features from MySQL are loading after 1.7 seconds, but the WMS layers are completely loading after 19.6 seconds!! (12 seconds after the features), all this time I have only the features without the background.

I have VPS so it's now because the server. why it taking so much time? How can I improve it? Is it because I'm loading from shapefiles? if I will import everything (the shapefiles) to the db and I will load the background with MySQL plugin for GeoServer as WMS layer its will be faster?

3
  • What is you server configuration (e.g. data on gis server, data on separate data server)? In data size, how large are your shapefiles? Also, are you setting render scales for the WMS layers at certain scales?
    – artwork21
    Oct 31 '13 at 16:41
  • Are your WMS and mysql layers in the same projection or different?
    – artwork21
    Oct 31 '13 at 16:44
  • all the files together are 60mb, can you give me link to read about the render scales because i dont know how to do it... and yes its the same projection
    – Jordan
    Oct 31 '13 at 16:45
4

Here are some things to be mindful of regarding performance when publishing data in GeoServer:

  • Make sure basemap and operational layers are in the same projection/coordinate system
  • Make sure large datasets are scaled to not render at all zoom levels (this is defined in the layer/WMS sld file)
  • Creating tiles from WMS's
  • Make sure your client viewer is referencing the GeoWebCache tiles (url example of cached layers http://serverName.xyz.com:80/geoserver/gwc/service/wms?tiled=true)
4
  • What do you mean with the second bullet?
    – user1919
    Jun 2 '15 at 14:20
  • 1
    @dkar, setting MaxScaleDenominator. For example, for layers with many features (so every feature does not draw while zoomed far out).
    – artwork21
    Jun 2 '15 at 20:08
  • Thanks.But is this related only to WFS features?
    – user1919
    Jun 3 '15 at 7:27
  • Sorry to bump this post, but is there some guide for the second bullet?
    – anexo
    Jun 2 '21 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.