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">&lt;<a href="mailto:James.Leveille@mtq.gouv.qc.ca">James.Leveille@mtq.gouv.qc.ca</a>&gt;</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&nbsp;by Alexandre Dubé a few weeks ago - 
helpfull</span></font></div>
<div><font size="2" color="#0000ff" face="Verdana"><span></span></font>&nbsp;</div>
<div><font size="2" color="#0000ff" face="Verdana"><span></span></font>&nbsp;</div>
<div><font size="2" color="#0000ff" face="Verdana"></font>&nbsp;</div>
<div><font size="2">
<p>Here&#39;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&#39;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&#39;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&amp;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/ &quot;/ms4w/Apache/cgi-bin/&quot;</p>
<p>ScriptAlias /fcgi-bin/ &quot;/ms4w/Apache/cgi-bin/&quot;</p>
<p>c) Remove :</p>
<p>&lt;Directory &quot;/ms4w/Apache/cgi-bin&quot;&gt;</p>
<p>AllowOverride All</p>
<p>Options None</p>
<p>Order allow,deny</p>
<p>Allow from all</p>
<p>&lt;/Directory&gt;</p>
<p>d) Add :</p>
<p>&lt;Location &quot;/cgi-bin&quot;&gt;</p>
<p>Options None</p>
<p>Order allow,deny</p>
<p>Allow from all</p>
<p>&lt;/Location&gt;</p>
<p>e) Add :</p>
<p>&lt;Location &quot;/fcgi-bin&quot;&gt;</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>&lt;/Location&gt;</p>
<p>f) Add :</p>
<p>&lt;IfModule fcgid_module&gt;</p>
<p>IPCCommTimeout 60</p>
<p>IdleTimeout 60</p>
<p>DefaultMinClassProcessCount 2</p>
<p>DefaultMaxClassProcessCount 20</p>
<p>DefaultInitEnv PROJ_LIB &quot;c:/ms4w/proj/nad/&quot;</p>
<p>DefaultInitEnv PATH </p>
<p>&quot;c:/ms4w/Apache/cgi-bin;c:/WINDOWS/system32;c:/WINDOWS;c:/WINDOWS/System32/Wbem;&quot;</p>
<p>DefaultInitEnv windir &quot;c:/WINDOWS&quot;</p>
<p>DefaultInitEnv SystemRoot &quot;c:/WINDOWS&quot;</p>
<p>DefaultInitEnv SystemDrive &quot;c:&quot;</p>
<p>DefaultInitEnv GDAL_DATA &quot;c:/ms4w/gdaldata&quot;</p>
<p>DefaultInitEnv GDAL_DRIVER_PATH &quot;c:/ms4w/gdalplugins&quot;</p>
<p>DefaultInitEnv TMP &quot;c:/ms4w/tmp&quot;</p>
<p>DefaultInitEnv TEMP &quot;c:/ms4w/tmp&quot;</p>
<p>&lt;/IfModule&gt;</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 &quot;CLOSE_CONNECTION=DEFER&quot;</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 &quot;fcti-bin&quot; 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>&nbsp;</p>
<p><font color="#0000ff" face="Verdana"></font>&nbsp;</p></font></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>
<p align="left"><span style="color: navy; font-family: &#39;Arial Black&#39;;" lang="FR-CA">______________________________________________________</span></p>
<p><span style="color: navy; font-family: &#39;Arial Black&#39;;" 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&#39;information<br>Ministère des Transports du 
Québec</font></font></span></p>
<p><span style="color: navy; font-family: &#39;Arial Black&#39;;" 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:&nbsp;&nbsp; (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>&nbsp;</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&#39;origine-----<br><b>De&nbsp;:</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é&nbsp;:</b> 12 décembre 2008 10:39<br><b>À&nbsp;:</b> 
  Marcelo Oliveira; <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br><b>Objet&nbsp;:</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>&nbsp;</div>
  <div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial">Thanks, I will try Fast CGI.&nbsp; 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>&nbsp;</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.&nbsp; 
    It is also possible that using other raster formats could 
    help.</span></p>
    <p><span style="font-size: 11pt; color: rgb(31, 73, 125);">&nbsp;</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);">&nbsp;</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);">&nbsp;</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>&nbsp;</p>
    <p><span style="font-size: 10pt; color: blue;">Hi,</span></p>
    <p>&nbsp;</p>
    <p><span style="font-size: 10pt; color: blue;">Are 
    there any&nbsp;effective tricks for&nbsp;making MapServer to Top-Fuel 
    class?&nbsp;&nbsp;We have now a typical ms4w installation on a rather good 
    server platform with SCSI&nbsp;drives and 2 four-core processors running on 
    Windows 2003 server.&nbsp;Our images are tiled, uncompressed geotiffs with 
    overviews, vector sample data set is shapefile with shptree index.&nbsp; 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&nbsp;(size 500 by 500 pixels) and 550 pictures from the vector layer 
    in png24 image format.&nbsp; 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.&nbsp; I wonder if anybody has tuned MapServer that 
    far.</span></p>
    <p>&nbsp;</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.&nbsp; 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.&nbsp; Have anybody tried to keep 
    mapfile,&nbsp; epsg-file or even tileindex&nbsp;files&nbsp;in RAM 
    drive?&nbsp; </span></p>
    <p>&nbsp;</p>
    <p><span style="font-size: 10pt; color: blue;">Having 
    about&nbsp;20 parallel users seems to be optimal for our server and if 
    I&nbsp;drive just WMS getCapabilities request against my mapfile I can get 
    about 1300 responses per minute.&nbsp; That leads me to think that 1200 
    rendered images per minute might be possible to reach with optimal 
    set-up.</span></p>
    <p>&nbsp;</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>