Re: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time
Where/how are you measuring times (server/client)? From: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] on behalf of Donald Kerr [donald.k...@dkerr.co.uk] Sent: Wednesday, June 06, 2012 2:35 PM To: 'mapserver-users' Subject: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time 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). Many thanks. Regards, Donald ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time
Steve, It's not a scientific measurement. For this particular example, the whole setup (server and client) is on a XP SP3 machine with 4 Gb memory. From the point when the mapping page is requested, the time taken to start seeing tiles returned is about 15 seconds. After that initial time, the images come in thick and fast. I'm pretty sure that it's the first load of mapserv.exe and, if the requested layer is via postgis, the first load of postgis. I'm trying to think of ways to speed up that initial load like, as I said in the last post, requesting a map tile on the fly (and hidden) so that mapserv.exe has been run once and is in memory ready for the next, or first 'real', request. It's probably the only downside to a system that I've got running like a little sweetie just now. It's basically a classic asp website running on IIS but I can switch between IIS and Apache for the mapping WMS/WFS. Both are quite fast and both run FastCGI though Apache seems a little more stable when a lot of tiles are requested with a lot of fast map drags; sometimes IIS gives up on individual request. Whether IIS or Apache, there's still this initial load delay of about 15 seconds. This may be something that I have to live with but I'm trying to improve that initial load if possible. To go back to your original question, my guess is that the load time is a server issue rather than a client problem though I may be wrong. Regards, Donald -Original Message- From: Lime, Steve D (DNR) [mailto:steve.l...@state.mn.us] Sent: 08 June 2012 15:03 To: Donald Kerr; 'mapserver-users' Subject: RE: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time Where/how are you measuring times (server/client)? From: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] on behalf of Donald Kerr [donald.k...@dkerr.co.uk] Sent: Wednesday, June 06, 2012 2:35 PM To: 'mapserver-users' Subject: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time 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). Many thanks. Regards, Donald ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time
I've noticed latency the first time mapserv is executed, presumably as a result of loading into memory and dynamic linking. Once the OS caches everything it's nice and snappy. I tend to see that only on my development versions though because on our production boxes the executables are hit often enough that they are always in memory. Unless access is very infrequent I'd think latency due to loading a binary would be rare. I suppose you could simulate traffic on the server-side to make sure everything is memory resident. That is, make a small request every 5 minutes or whatever using cron or the Windows equivalent. I'm not experienced enough with PostGIS to know if there's any tuning to do there. Maybe others have ideas. Steve From: Donald Kerr [donald.k...@dkerr.co.uk] Sent: Friday, June 08, 2012 9:16 AM To: Lime, Steve D (DNR); 'mapserver-users' Subject: RE: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time Steve, It's not a scientific measurement. For this particular example, the whole setup (server and client) is on a XP SP3 machine with 4 Gb memory. From the point when the mapping page is requested, the time taken to start seeing tiles returned is about 15 seconds. After that initial time, the images come in thick and fast. I'm pretty sure that it's the first load of mapserv.exe and, if the requested layer is via postgis, the first load of postgis. I'm trying to think of ways to speed up that initial load like, as I said in the last post, requesting a map tile on the fly (and hidden) so that mapserv.exe has been run once and is in memory ready for the next, or first 'real', request. It's probably the only downside to a system that I've got running like a little sweetie just now. It's basically a classic asp website running on IIS but I can switch between IIS and Apache for the mapping WMS/WFS. Both are quite fast and both run FastCGI though Apache seems a little more stable when a lot of tiles are requested with a lot of fast map drags; sometimes IIS gives up on individual request. Whether IIS or Apache, there's still this initial load delay of about 15 seconds. This may be something that I have to live with but I'm trying to improve that initial load if possible. To go back to your original question, my guess is that the load time is a server issue rather than a client problem though I may be wrong. Regards, Donald -Original Message- From: Lime, Steve D (DNR) [mailto:steve.l...@state.mn.us] Sent: 08 June 2012 15:03 To: Donald Kerr; 'mapserver-users' Subject: RE: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time Where/how are you measuring times (server/client)? From: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] on behalf of Donald Kerr [donald.k...@dkerr.co.uk] Sent: Wednesday, June 06, 2012 2:35 PM To: 'mapserver-users' Subject: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time 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). Many thanks. Regards, Donald ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time
Steve, I have a server setup, IIS on Windows Server 2003, that is hit often enough that it's always fast. The single client server on the one machine setup where maps are hit infrequently is the big issue for me. I will try using the Windows AT command to set up a schedule to see if that makes a difference as you suggest. As I said before, the hidden window map request didn't seem to make a difference; almost as if it weren't part of the same session. Some more experimenting on my side is required. I will post back here should I make some progress. Cheers. Donald -Original Message- From: Lime, Steve D (DNR) [mailto:steve.l...@state.mn.us] Sent: 08 June 2012 15:25 To: Donald Kerr; 'mapserver-users' Subject: RE: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time I've noticed latency the first time mapserv is executed, presumably as a result of loading into memory and dynamic linking. Once the OS caches everything it's nice and snappy. I tend to see that only on my development versions though because on our production boxes the executables are hit often enough that they are always in memory. Unless access is very infrequent I'd think latency due to loading a binary would be rare. I suppose you could simulate traffic on the server-side to make sure everything is memory resident. That is, make a small request every 5 minutes or whatever using cron or the Windows equivalent. I'm not experienced enough with PostGIS to know if there's any tuning to do there. Maybe others have ideas. Steve From: Donald Kerr [donald.k...@dkerr.co.uk] Sent: Friday, June 08, 2012 9:16 AM To: Lime, Steve D (DNR); 'mapserver-users' Subject: RE: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time Steve, It's not a scientific measurement. For this particular example, the whole setup (server and client) is on a XP SP3 machine with 4 Gb memory. From the point when the mapping page is requested, the time taken to start seeing tiles returned is about 15 seconds. After that initial time, the images come in thick and fast. I'm pretty sure that it's the first load of mapserv.exe and, if the requested layer is via postgis, the first load of postgis. I'm trying to think of ways to speed up that initial load like, as I said in the last post, requesting a map tile on the fly (and hidden) so that mapserv.exe has been run once and is in memory ready for the next, or first 'real', request. It's probably the only downside to a system that I've got running like a little sweetie just now. It's basically a classic asp website running on IIS but I can switch between IIS and Apache for the mapping WMS/WFS. Both are quite fast and both run FastCGI though Apache seems a little more stable when a lot of tiles are requested with a lot of fast map drags; sometimes IIS gives up on individual request. Whether IIS or Apache, there's still this initial load delay of about 15 seconds. This may be something that I have to live with but I'm trying to improve that initial load if possible. To go back to your original question, my guess is that the load time is a server issue rather than a client problem though I may be wrong. Regards, Donald -Original Message- From: Lime, Steve D (DNR) [mailto:steve.l...@state.mn.us] Sent: 08 June 2012 15:03 To: Donald Kerr; 'mapserver-users' Subject: RE: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time Where/how are you measuring times (server/client)? From: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] on behalf of Donald Kerr [donald.k...@dkerr.co.uk] Sent: Wednesday, June 06, 2012 2:35 PM To: 'mapserver-users' Subject: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time 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). Many thanks. Regards, Donald ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
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@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time
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-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna Sent: 08 June 2012 16:10 To: mapserver-users@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@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
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" 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-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna > Sent: 08 June 2012 16:10 > To: mapserver-users@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@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Mapserver/PostGIS Faster Initial Load Time
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()",2); = 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:mikesa...@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" 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-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jeff McKenna Sent: 08 June 2012 16:10 To: mapserver-users@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 alwa