<div>Thanks for the response Ken. Sorry, guess I wasn't too clear about my question, part of my question is also about the lifecycle of the XML-RPC server. Your response was rather generic in terms of PHP and not XML-RPC "server" via PHP.<br>
</div><div><br></div><div>With other languages where the HTTP server is bundled/built into the XML-RPC server, the lifecycle is you start up server, that's the instance of the server and it ends when you shut down the server. During its lifecycle/operation, all requests to the server go through the same XML-RPC server instance.</div>
<div><br></div><div>From your response and a re-looking at the code, I'm using these as reference</div><div><br></div><div><a href="http://phpxmlrpc.sourceforge.net/server.php?showSource=TRUE">http://phpxmlrpc.sourceforge.net/server.php?showSource=TRUE</a></div>
<div>PHP XML-RPC server doc: <a href="http://phpxmlrpc.sourceforge.net/doc-2/ch07s05.html">http://phpxmlrpc.sourceforge.net/doc-2/ch07s05.html</a></div><div><br></div><div>It appears the lifecycle is the "XML-RPC server" is initialized on an HTTP request to any PHP page that invokes the "XML-RPC server" (whether directly in the page code or via code in include file), and that the server sorta stops after it completes the HTTP response back to the requesting client? Because otherwise, the PHP module on the HTTP server would keep spawning XML-RPC server instances if its lifecycle didn't end with the response being sent back (memory leak, etc.), unless of course the PHP module knew to reuse the server on subsequent requests.</div>
<div><br></div><div>David</div><br><div class="gmail_quote">On Tue, Dec 25, 2012 at 3:35 AM, Ken Almond <span dir="ltr"><<a href="mailto:ken@almondenterprises.com" target="_blank">ken@almondenterprises.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Apache (when configured) loads a php.so module – so PHP is ‘loaded’ (ready to go) as part of apache startup.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Yes, when HTTP hits Apache, the server.php file is loaded (on each HTTP request).     Since php.so module is already running as part of apache startup – its ‘very fast’ BUT you do want to keep server.php files smaller (1,000(s) of lines) instead of 50,000(s) of lines.     We used a URL name space to have multiple server.php files – e.g.    <a href="http://host/login.php" target="_blank">http://host/login.php</a>  (login.php is a server.php file),   <a href="http://host/accounts.php" target="_blank">http://host/accounts.php</a>,   etc. -  e.g. 1 ‘server.php’ for grouping of web services.   The login.php and account.php, and x.php and y.php can call into shared library.php(s) but again, overall, keep the #includes smaller so each server.php is not ‘too large’.     We achieved average 10ms (where php called MSSQL inside) response time for 1,000(s) of simultaneous users on single apache server.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Bonus tip</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">We put 1<sup>st</sup> apache server in DNZ zone (publically available for URL) and then used apache reverse proxy over to internal apache that that actually called the server.php(s) for very strong protection.    Worked very well.     Then as we grew, we used the reverse proxy to load balance – but apache also has other forms of load balance.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Good Luck</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Ken</span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:phpxmlrpc-bounces@lists.usefulinc.com" target="_blank">phpxmlrpc-bounces@lists.usefulinc.com</a> [mailto:<a href="mailto:phpxmlrpc-bounces@lists.usefulinc.com" target="_blank">phpxmlrpc-bounces@lists.usefulinc.com</a>] <b>On Behalf Of </b>David Luu<br>
<b>Sent:</b> Monday, December 24, 2012 10:35 PM<br><b>To:</b> <a href="mailto:phpxmlrpc@lists.usefulinc.com" target="_blank">phpxmlrpc@lists.usefulinc.com</a><br><b>Subject:</b> [phpxmlrpc] How to start/stop XML-RPC server?</span></p>
<div><div class="h5"><p class="MsoNormal"> </p><div><p class="MsoNormal">I'm just looking into XML-RPC server with PHP, so have not much idea about its implementation and design.</p></div><div><p class="MsoNormal"> </p>
</div><div><p class="MsoNormal">With other language implementations, it's easy to understand, as you can start/stop the server from command line (or other interface like UI, XML-RPC call for stop, etc.) as all the server functionality can be combined with the XML-RPC server itself as a single self contained binary/application.</p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">With PHP, the PHP code is served by a web/application server. So wanted some clarification:</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">
* how do you start the server? Start up the web/application server (Apache, IIS, etc.), then hit the URL to the PHP script that creates the server instance? Are the XML-RPC requests (different XML-RPC method calls) going to same URL or different one?</p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">* how do you stop the PHP XML-RPC server? Stop the web/application server itself? (e.g. Apache, IIS, etc.) Or is there a way to stop it w/o turning off the whole web/application server or say killing PHP.</p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">David</p></div></div></div></div></div></blockquote></div><br>