I think serving pre-cached tiles with TileCache running under FastCGI should improve your response times considerably.<br><br>Roger<br>--<br>PS - Give send an update if you try any of these.<br><br><div class="gmail_quote">
On Fri, Dec 12, 2008 at 8:00 AM, Léveillé, James <span dir="ltr"><<a href="mailto:James.Leveille@mtq.gouv.qc.ca">James.Leveille@mtq.gouv.qc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div vlink="purple" link="blue" bgcolor="white" lang="EN-US">
<div><font size="2" color="#0000ff" face="Verdana"><span>Here
is a message published by Alexandre Dubé a few weeks ago -
helpfull</span></font></div>
<div><font size="2" color="#0000ff" face="Verdana"><span></span></font> </div>
<div><font size="2" color="#0000ff" face="Verdana"><span></span></font> </div>
<div><font size="2" color="#0000ff" face="Verdana"></font> </div>
<div><font size="2">
<p>Here's how to install and setup fastCGI with Apache 2.2.8 contained in </p>
<p>the MS4W 2.2.7 version.</p>
<p>1- MS4W 2.2.7 contains a MapServer compiled to support FastCGI so </p>
<p>nothing needs to be done there.</p>
<p>2- But, Apache 2.2.8 that comes with MS4W 2.2.7 doesn't include the </p>
<p>mod_fcgi module. This module can be dowloaded at </p>
<p></p></font><a href="http://www.apachelounge.com/download/" target="_blank"><u><font size="2" color="#0000ff">http://www.apachelounge.com/download/</font></u></a><font size="2"> ...
Take the
<p>mod_fcgid-2.2a-w32.zip which will work with Apache 2.2.8.</p>
<p>3- Copy mod_fcgid.so to your apache/modules folder</p>
<p>4- Install the Visual C++ 2008 Redistributable Package (the binary is </p>
<p>build with VC 2008). Download and install, if it isn't already done, </p>
<p>from: </p>
<p></p></font><a><u><font size="2" color="#0000ff">www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en</font></u></a><font size="2">
<p>5- Modify your /ms4w/Apache/conf/httpd.conf</p>
<p>a) Add :</p>
<p>LoadModule fcgid_module modules/mod_fcgid.so</p>
<p>b) Add :</p>
<p>ScriptAlias /cgi-bin/ "/ms4w/Apache/cgi-bin/"</p>
<p>ScriptAlias /fcgi-bin/ "/ms4w/Apache/cgi-bin/"</p>
<p>c) Remove :</p>
<p><Directory "/ms4w/Apache/cgi-bin"></p>
<p>AllowOverride All</p>
<p>Options None</p>
<p>Order allow,deny</p>
<p>Allow from all</p>
<p></Directory></p>
<p>d) Add :</p>
<p><Location "/cgi-bin"></p>
<p>Options None</p>
<p>Order allow,deny</p>
<p>Allow from all</p>
<p></Location></p>
<p>e) Add :</p>
<p><Location "/fcgi-bin"></p>
<p># The following line activates the fastCGI script to all files </p>
<p>in location</p>
<p>SetHandler fcgid-script</p>
<p>Options None</p>
<p>Order allow,deny</p>
<p>Allow from all</p>
<p></Location></p>
<p>f) Add :</p>
<p><IfModule fcgid_module></p>
<p>IPCCommTimeout 60</p>
<p>IdleTimeout 60</p>
<p>DefaultMinClassProcessCount 2</p>
<p>DefaultMaxClassProcessCount 20</p>
<p>DefaultInitEnv PROJ_LIB "c:/ms4w/proj/nad/"</p>
<p>DefaultInitEnv PATH </p>
<p>"c:/ms4w/Apache/cgi-bin;c:/WINDOWS/system32;c:/WINDOWS;c:/WINDOWS/System32/Wbem;"</p>
<p>DefaultInitEnv windir "c:/WINDOWS"</p>
<p>DefaultInitEnv SystemRoot "c:/WINDOWS"</p>
<p>DefaultInitEnv SystemDrive "c:"</p>
<p>DefaultInitEnv GDAL_DATA "c:/ms4w/gdaldata"</p>
<p>DefaultInitEnv GDAL_DRIVER_PATH "c:/ms4w/gdalplugins"</p>
<p>DefaultInitEnv TMP "c:/ms4w/tmp"</p>
<p>DefaultInitEnv TEMP "c:/ms4w/tmp"</p>
<p></IfModule></p>
<p>6- Restart Apache : /ms4w/apache-restart.bat</p>
<p>7- In your mapfile, set a PROCESSING directive to tell FastCGI to cache </p>
<p>the connections and layer information on all layers for which connection </p>
<p>caching is desired - ie. all slow layers.</p>
<p>a) Add :</p>
<p>PROCESSING "CLOSE_CONNECTION=DEFER"</p>
<p>8- Now you can load your map using either normal CGI or FastCGI :</p>
<p>a) CGI :</p>
<p></p></font><a href="http://host:port/cgi-bin/mapserv.exe" target="_blank"><u><font size="2" color="#0000ff">http://host:port/cgi-bin/mapserv.exe</font></u></a><font size="2">?...
<p>b) fastCGI :</p>
<p></p></font><a href="http://host:port/fcgi-bin/mapserv.exe" target="_blank"><u><font size="2" color="#0000ff">http://host:port/fcgi-bin/mapserv.exe</font></u></a><font size="2">?...
<p>That way, your original cgi-bin folder wont be affected by fastCGI </p>
<p>unless you use the modified url with "fcti-bin" which is the alias you </p>
<p>added to your httpd.conf file at 5b).</p>
<p>Special thanks to Jeff McKenna and Daniel Morissette who helped me a lot </p>
<p>with this.</p>
<p> </p>
<p><font color="#0000ff" face="Verdana"></font> </p></font></div>
<div> </div>
<div> </div>
<div>
<p align="left"><span style="color: navy; font-family: 'Arial Black';" lang="FR-CA">______________________________________________________</span></p>
<p><span style="color: navy; font-family: 'Arial Black';" lang="FR-CA"><font size="2"><font face="Verdana"><font size="4"><b>JAMES
LÉVEILLÉ<br></b></font>Service des systèmes de Mission<br>Direction des
technologies de l'information<br>Ministère des Transports du
Québec</font></font></span></p>
<p><span style="color: navy; font-family: 'Arial Black';" lang="FR-CA"><font size="2" face="Verdana">5833, boul. Pierre-Bertrand, 2ième étage<br>Québec (Québec)
G2K 1K7<br>Téléphone: (418) 380-2005 poste 227<br>Télécopieur: (418)
644-6653<br><a href="mailto:james.leveille@mtq.gouv.qc.ca" target="_blank"><font color="#000080">james.leveille@mtq.gouv.qc.ca</font></a><br></font></span></p>
<p><font color="#000080"></font> </p></div>
<blockquote dir="ltr" style="margin-right: 0px;">
<div></div>
<div dir="ltr" align="left" lang="fr"><font size="2" face="Tahoma">-----Message d'origine-----<br><b>De :</b>
<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>
[mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>] <b>De la part de</b> Rahkonen
Jukka<br><b>Envoyé :</b> 12 décembre 2008 10:39<br><b>À :</b>
Marcelo Oliveira; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br><b>Objet :</b> Re:
[mapserver-users] How to make MapServer WMS super fast?<br><br></font></div><div class="Ih2E3d">
<div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial">Hi,</font></span></div>
<div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial">Thanks, I will try Fast CGI. Are there some simple
enough document for a ms4w users about how to turn the system to use Fast
CGI?</font></span></div>
<div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial">-Jukka-</font></span></div><br>
<blockquote dir="ltr" style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div dir="ltr" align="left" lang="fi">
<hr>
<font size="2" face="Tahoma"><b>Lähettäjä:</b> Marcelo Oliveira
[mailto:<a href="mailto:moliveira@GEOSTATS.com" target="_blank">moliveira@GEOSTATS.com</a>] <br><b>Lähetetty:</b> 12. joulukuuta 2008
17:05<br><b>Vastaanottaja:</b> Rahkonen Jukka;
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br><b>Aihe:</b> RE: [mapserver-users] How to
make MapServer WMS super fast?<br></font><br></div>
<div></div>
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Try
using Fast CGI, it should improve your latency problem you are seeing.
It is also possible that using other raster formats could
help.</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Good
luck! M</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="PT-BR">--------------</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="PT-BR">Marcelo
Simas Oliveira</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="PT-BR">GeoStats
LP</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="PT-BR">530
Means St., Ste. 310</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Atlanta,
Georgia 30318</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">(404)
588-1004</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"><a href="http://www.geostats.com" target="_blank">www.geostats.com</a></span></p></div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">
<p><b><span style="font-size: 10pt; color: windowtext;">From:</span></b><span style="font-size: 10pt; color: windowtext;">
<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>
[mailto:<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of
</b>Rahkonen Jukka<br><b>Sent:</b> Friday, December 12, 2008 10:01
AM<br><b>To:</b> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br><b>Subject:</b>
[mapserver-users] How to make MapServer WMS super
fast?</span></p></div></div>
<p> </p>
<p><span style="font-size: 10pt; color: blue;">Hi,</span></p>
<p> </p>
<p><span style="font-size: 10pt; color: blue;">Are
there any effective tricks for making MapServer to Top-Fuel
class? We have now a typical ms4w installation on a rather good
server platform with SCSI drives and 2 four-core processors running on
Windows 2003 server. Our images are tiled, uncompressed geotiffs with
overviews, vector sample data set is shapefile with shptree index. I
have a shortened epsg file and my mapfile is extra short. Bandwith is not
the limit. We are getting out now about 450 orthoimage pictures per
minute (size 500 by 500 pixels) and 550 pictures from the vector layer
in png24 image format. I consider that rather good, but we are
required to reach 20 images per second, thus 1200 images per minute or 0.05
seconds per image. I wonder if anybody has tuned MapServer that
far.</span></p>
<p> </p>
<p><span style="font-size: 10pt; color: blue;">I am
willing to try however exotic solutions to reach the 20 WMS output
images/second goal if somebody could suggest me what to try next. In
our system there seems to be about 0.1 second ballast with WMS getMap
requests and I cannot get any faster response even if I try with on empty
data layer with nothing to render. Have anybody tried to keep
mapfile, epsg-file or even tileindex files in RAM
drive? </span></p>
<p> </p>
<p><span style="font-size: 10pt; color: blue;">Having
about 20 parallel users seems to be optimal for our server and if
I drive just WMS getCapabilities request against my mapfile I can get
about 1300 responses per minute. That leads me to think that 1200
rendered images per minute might be possible to reach with optimal
set-up.</span></p>
<p> </p>
<p><span style="font-size: 10pt; color: blue;">-Jukka
Rahkonen-</span></p></div></blockquote></div></blockquote></div>
<br>_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br></blockquote></div><br>