Hi All <br> I am a newbie in the <a href=http://www.opensolaris.org/os/project/webstack/>Web Stack</a> project within opensolaris community and would like to get your expert opinion on what should be the default MPM for next version of Apache 2.2 with Solaris Express Developer Release (SXDE) <br> Here is a brief write up that I have come up with and would really like to get your feedback on this issue. I was wondering, if this post can be considered as a follow up to the <a href="http://www.opensolaris.org/jive/thread.jspa?messageID=101951&">ARC case discussion</a> regarding Apache 2.2.4 with SXDE <br>
<html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> </head> <body> <h2> <font face="Albany, sans-serif"><font size="4">Choosing the Default MPM for Apache 2.2 HTTP Server for SXDE</font></font></h2> <h2> <font face="Albany, sans-serif"><font size="4">pre-fork , worker or event ?</font></font></h2> <h3>What is MPM ?</h3> <p></p> <p></p> <div class="moz-text-flowed" style="font-family: -moz-fixed; font-size: 13px;" lang="x-western">Multi Processing Module (MPM) is a plug-in module within Apache 2.2 HTTP server and is responsible for handling the basic tasks of the web server like - binding to network ports on the machine, accepting incoming HTTP requests, and dispatching children to handle requests. <br> <br> Apache 2.2 web server ships with a multiple Multi Processing Modules (MPMs) to appropriately serve the customer needs. However, only one MPM can be loaded or configured into the server at any given time. The list of available MPMs is available on the <a href="http://httpd.apache.org/docs/2.2/mod/">Apache 2.2 module index </a>page. <br> <br> <h3>Available MPMs with Apache 2.2 on Unix / Linux </h3> The following Multi-Processing Module (MPM) architectures are available for the Apache HTTP server on UNIX/Linux platforms: <br> <br> <ul> <li><a href="http://httpd.apache.org/docs/2.2/mod/prefork.html">pre-fork MPM</a> </li> </ul> <ul style="margin-left: 40px;"> <li>Default MPM for the Apache 2.2 HTTP server. Implements a non-threaded, pre-forking web server. Provides backward compatibility with Apache 1.3 server. </li> </ul> <ul> <li><a href="http://httpd.apache.org/docs/2.2/mod/worker.html">worker MPM</a></li> </ul> <ul style="margin-left: 40px;"> <li>Designed with the goal to address the scalability issues seen with pre-fork MPM. Requires all third party libraries, extensions and dynamic web technologies(like PHP) that runs on top of worker MPM to be thread safe. <br> </li> </ul> <ul> <li><a href="http://httpd.apache.org/docs/2.2/mod/event.html">event MPM</a> </li> </ul> <ul style="margin-left: 40px;"> <li>Based on worker MPM and designed with the goal to serve more concurrent requests by passing off some processing work to supporting threads, freeing up the main threads to work on new requests. Still experimental and not recommended for production usage </li> </ul> <h3>Considerations in choosing the default Apache 2.2 MPM for SXDE</h3> <h4>Backward Compatibility</h4> Apache 2.2 pre-fork MPM is designed to provide backward compatibility with Apache 1.x based web server. This allows customers to easily upgrade to Apache 2.2.x based HTTP server without compromising any stability. <br> <br> <h4>Stability</h4> With pre-fork MPM, crash in a web application will affect only a single request, namely the request that was being processed in a given 'httpd' process. While, with worker MPM, crash in a web application will affect all the requests currently handled by all the threads in a given 'httpd' process. Accordingly, increasing the number of threads to increase the scalability also increases the number of requests exposed to a process failure. <br> <br> With worker MPM, all deployed third party libraries need to be thread safe. The current state of thread safety issues with third party plug-ins is captured in <a href="http://httpd.apache.org/docs/2.2/developer/thread_safety.html">Apache's Thread Safety Issues</a>. These thread safety and reliability concerns is probably the main contributing factor for Apache pre-fork MPM model to be still the preferred model in LAMP stack. <br> <br> Also, because of thread safety concerns with PHP runtime and with php extensions available through <a href="http://pear.php.net">PEAR</a> ,PHP team still seems to recommend Apache pre-fork MPM model (as mentioned in section <a href="http://us2.php.net/manual/en/faq.installation.php#faq.installation.apache2">Configuring PHP with Apache2 using worker MPM</a>), if PHP is to be used with Apache using mod_php.<br> <br> <h4>Performance</h4> Some of the unofficial performance benchmark results available on the internet like <a href="http://www.gnegg.ch/archives/305-mod_php,-LightTPD,-FastCGI-Whats-fastest.html">mod_php, LightTPD, FastCGI - What's fastest?</a> , and <a href="http://hell.jedicoder.net/?p=101">T2000 Apache Worker or pre-fork ?</a> does seem to consistently infer that pre-fork MPM with PHP as mod_php module is very competitive compared to Apache 2.2 worker MPM with PHP as mod_fastcgi module <br> <br> While handling SSL transactions with worker MPM and OpenSSL, there seems to be potential instabilities under extreme load. Individual bugs have been filed against these components in Solaris. These kind of instabilities are not seen with pre-fork MPM and OpenSSL. <br> <br> <br> <h3>Final thoughts </h3> <br> pre-fork MPM is designed to provide compatibility and stability to vast Apache 1.x based applications while worker MPM - combination of multi-process and multi-threaded architecture, is designed to address server scalability and can be an ideal candidate for the default MPM. However, multiple performance comparisons of the two MPMs suggest no compelling advantage of worker over pre-fork at least on Solaris platform. <br> <br> In reality, there are a number of third party applications and extensions (as in PHP) that rely on pre-fork MPM. Given the existing application compatibility advantage of pre-fork and no compelling evidence of worker MPM's performance advantages, pre-fork MPM can still be considered as the default MPM for Apache 2.2 within Solaris Developer Express. <br> <br> <br> So, what do you guys think ? <br> <br> Thanks <br> Sriram <br> </div> <p></p> </body> </html> This message posted from opensolaris.org
