<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>Hi Jason,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>Does setting StartServers = MaxServers eliminate the 
connection errors?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>Here's some more background on the IIS FastCGI 
extension.&nbsp; Isapi_fcgi.dll does&nbsp;recycle the processes.&nbsp; Memory 
leaks will accumulate for a while but resource consuming php-cgi.exe and 
mapagent.exe processes should drop off after a while.&nbsp; The only catch is 
that isapi_fcgi gives no control over how long the processes should stay 
alive.&nbsp; For PHP, setting the&nbsp;following environment variables may help 
roll the processes a little quicker:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>PHP_FCGI_MAX_REQUESTS=500</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>PHP_FCGI_CHILDREN=1</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>These can be set by adding&nbsp;a registry setting under 
FASTCGI/.php</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>Environment REG_BINARY (0x0D delimited set of environment 
variables,&nbsp;terminated with 0x00)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>eg.&nbsp; <SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>PHP_FCGI_MAX_REQUESTS=500 0x0D </FONT></SPAN><SPAN 
class=621241500-17112006><FONT face=Arial color=#0000ff 
size=2>PHP_FCGI_CHILDREN=1 0x0D 0x00</FONT></SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006><FONT face=Arial 
color=#0000ff size=2>Trevor</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=621241500-17112006>&nbsp;</SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Jason Birch 
[mailto:Jason.Birch@nanaimo.ca] <BR><B>Sent:</B> Thursday, November 16, 2006 
5:12 PM<BR><B>To:</B> users@mapguide.osgeo.org<BR><B>Cc:</B> Trevor 
Wekel<BR><B>Subject:</B> RE: [mapguide-users] RE: Studio Enterprise and Web 
Studio Cannot Connect Randomly<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2>For anyone who's keeping track...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2>Setting the StartServers to a higher number did not seem to 
help me.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2>What&nbsp;has seemed to help&nbsp;was setting the 
StartServers and MaxServers to the same number.&nbsp; I guess this is OK if 
you're not worried about memory leaks or dynamic resource allocation on your 
server.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2>It looks to me like any time a&nbsp;MapAgent child process 
is killed on Windows, the FastCGI ISAPI handler doesn't&nbsp;get 
informed&nbsp;about it, and the first request fails. If you&nbsp;restart IIS 
after killing a process, you don't get the error; a new process is just started 
up.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=492375421-16112006><FONT face=Arial 
color=#0000ff size=2>Jason</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Jason Birch 
[mailto:Jason.Birch@nanaimo.ca] <BR><B>Sent:</B> Wednesday, November 15, 2006 
12:41<BR><B>To:</B> users@mapguide.osgeo.org<BR><B>Cc:</B> Trevor 
Wekel<BR><B>Subject:</B> RE: [mapguide-users] RE: Studio Enterprise and Web 
Studio Cannot Connect Randomly<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2>Thanks, I'll give that a try.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2>Apparently these can be set on a per-service level, 
under</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff 
size=2>HKEY_LOCAL_MACHINE\SOFTWARE\FASTCGI\.fcgi</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2>And there is an "Environment"&nbsp;setting.&nbsp; Maybe 
this could be used to overcome the problem with the PROJ_LIB variable not 
getting picked up?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2><A 
href="http://viewcvs.php.net/viewvc.cgi/fastcgi-isapi/readme.txt?view=markup">http://viewcvs.php.net/viewvc.cgi/fastcgi-isapi/readme.txt?view=markup</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=307523420-15112006><FONT face=Arial 
color=#0000ff size=2>Jason</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Trevor Wekel<BR><B>Subject:</B> RE: 
[mapguide-users] RE: Studio Enterprise and Web Studio Cannot Connect 
Randomly<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2>Hi Jason,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2>Telling isapi_fcgi and mod_fastcgi to spin up&nbsp;two 
servers might help but I've had trouble forcing them to spin up agents.&nbsp; 
mod_fastcgi is especially obstinate.&nbsp; Even under load it doesn't like to 
spin up more than one agent.&nbsp; Here are the appropriate 
settings:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2>For IIS:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2>Increase&nbsp;the registry setting 
HKEY_LOCAL_MACHINE\SOFTWARE\FASTCGI</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2>StartServers REG_DWORD 1 </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=747165019-15112006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff size=2>For 
Apache, modify httpd.conf and increase -minProcesses:</FONT></SPAN></DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2>Change</FONT></SPAN></DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2>FastCgiConfig -idle-timeout 120 -minProcesses 1 -maxClassProcesses 4 
-multiThreshold 100 -singleThreshold 100 -killInterval 600</FONT></SPAN></DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2>to</FONT></SPAN></DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=747165019-15112006><SPAN class=747165019-15112006><FONT 
face=Arial color=#0000ff size=2>FastCgiConfig -idle-timeout 120 -minProcesses 2 
-maxClassProcesses 4 -multiThreshold 100 -singleThreshold 100 -killInterval 
600</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=747165019-15112006><FONT face=Arial color=#0000ff 
size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial 
color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff 
size=2></FONT><BR><FONT face=Arial><FONT color=#0000ff><FONT size=2>Note<SPAN 
class=747165019-15112006>:&nbsp; PHP uses a different configuration line and 
should already be spinning up 4 processes:</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=747165019-15112006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2>FastCgiServer "C:/Program 
Files/MapGuideOpenSource/WebServerExtensions/php/php-cgi.exe" -processes 4 
-idle-timeout 120 -<BR>initial-env PHP_FCGI_MAX_REQUESTS=500 -initial-env 
PHP_FCGI_CHILDREN=1^M</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV></BODY></HTML>