[mapserver-users] Mapserver/PostGIS Faster Initial Load Time

Donald Kerr donald.kerr at dkerr.co.uk
Mon Jun 11 08:05:49 PDT 2012


Mike,

It is very likely that tinkering with IIS will result in faster initial
rendering but, from some experiments that I've carried out today, Apache
wins hands down.

I have now managed to create a "pre-load" page that runs on boot up.
Basically, this is a page that loads a map via IIS or Apache depending on
which web server that I have the software configured to use.

Here are the (very rough) times - Each run was done on a fresh boot up:

Without a pre-load page:
					IIS	Apache
Time to First Raster Tile	15s	11s
Time to First PostGIS Tile	8s	7s

With a pre-load page:
					IIS	Apache
Time to First Raster Tile	5s	4s
Time to First PostGIS Tile	5s	3s

All subsequent map requests are as good as instant, even after closing and
reopening the browser.

The pre-load page includes the following code:

=================
var preloadWindow = new ActiveXObject('InternetExplorer.Application');
preloadWindow.FullScreen = true;
preloadWindow.Navigate('http://localhost/map/map.asp?ZoomLevel=14&Easting=25
8544&Northing=665909');
preloadWindow.Visible = true;
setTimeout("preloadWindow.quit()",20000);
=================

The only thing that doesn't seem to work is a pre-load page using the above
code that doesn't actually set the window as "Visible" which would be a
nicer solution. I should also be able to trim down the map page so that only
a map is requested rather tha a full set of tiles and the surrounding visual
code.

The only other possible improvement that I can think about is a leaner
mapserv.exe that's compiled with only the features that I'm using.

Thanks for all the pointers folks.

Regards,

Donald

-----Original Message-----
From: Mike Saunt [mailto:mikesaunt at gmail.com] 
Sent: 10 June 2012 15:22
To: Donald Kerr
Cc: MAPSERVER USERS; Jeff McKenna
Subject: Re: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time


Not sure if this helps but often with IIS there is a lag at startup to load
things up,  plenty of microsoft doco out there regarding it... 
On Jun 9, 2012 4:13 PM, "Donald Kerr" <donald.kerr at dkerr.co.uk> wrote:

Jeff,

Great tip!

My deployment uses a full compressed build of the openlayers.js file with
some changes to vml.js (uses vml textpath - for <= IE8) and svg.js (uses
text rotation - for Chrome and Firefox). This file comes in at 927 KB.

I created a custom compressed build of the openlayers.js file, again
including the vml and svg changes. The new file comes in at 443 KB; a very
significant drop in size.

Both files were built using the latest, hot off the press,
OpenLayers-2.12-rc6.

Prior to creating and using the new, smaller openlayers.js file, I tested
the time to get the first raster image tile from boot up with the larger
file which was 16 seconds. I did a one click zoom to the first layer that
has PostGIS sitting behind it and that took a further 8 seconds. After that
initial load of both layer types, everything is speedy with very little
delay at all.

I then substituted the new, smaller openlayers.js file and repeated the
process from boot up. Low and behold, I get exactly the same results: 16
seconds then 8 seconds. Whilst there is probably a time saving in terms of
milliseconds, the perceptional difference is nil.

However, I do agree that the smaller openlayers.js file is the way to go in
terms of reducing unnecessary initial traffic and also having less
javascript in memory; something that will no doubt aid Internet Explorer
speed-wise as that particular platform is chronic at best.

Thanks again for the tip.

Regards,

Donald



-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jeff McKenna
Sent: 08 June 2012 16:10
To: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time


On 12-06-06 4:35 PM, Donald Kerr wrote:
> Basically my mapping setup is, from client to server, Openlayers
> WMS/WFS (Internet Explorer on XP Pro SP3) - Mapserver CGI - Shapefile
> (Tiffs) or PostGIS (XP Pro SP3 - IIS & FastCGI).
>
>>From boot up, the initial, or first load of maps, takes up to 15
>>seconds.
> After that, it flies along fine.
>
> I've tried pre-loading in a hidden browser instance but that didn't
> work. I cannot get that initial load time down at all.
>
> Any tips to reduce the time taken for the first load of the software:
> Specifically Mapserver whether it's creating the map from PostGIS or
> the shapefile (Tiffs).

I can give my experiences here.  I have a very slow server that I use for
client demos, and I very often hit this exact same issue (my
OpenLayers/MapServer WMS/WFS application takes very long to load initially,
then zooms along).  In my case, the long initial load is always due to the
large lib/OpenLayers.js file; I solve this by generating an
'OpenLayers-lite.js' file (through the instructions at
http://docs.openlayers.org/library/deploying.html).

I hope that helps someone along the way.

Have a nice weekend all.

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services http://www.gatewaygeomatics.com/


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
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