    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>2skies.com :: Multiple php pools and their advantages</title>
        <link>http://2skies.com/docs/Multiple_php_pools_and_their_advantages</link>
        <description>Hosting-Development-Support :: Experience the difference</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:support@2skies.com" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>

<!-- show a header for the current publication type -->
        <h2>library</h2>


<div class="xar-mod-head"><span class="xar-mod-title">web development and webmaster best practice + lighttpd</span></div>

<table border="0" cellpadding="1" cellspacing="0">
<tr>
    <td valign="top">
        Browse in :
   </td>
   <td valign="top">

                                    <a href="http://2skies.com/docs/">All</a>

                 &gt;                     <a href="http://2skies.com/docs/c43/">Documentation</a>

                 &gt;                     <a href="http://2skies.com/docs/c68/">knowledge base</a>
<br />

                                    <a href="http://2skies.com/docs/">All</a>

                 &gt;                     <a href="http://2skies.com/docs/c71/">Subject</a>

                 &gt;                     <a href="http://2skies.com/docs/c73/">Software</a>

                 &gt;                     <a href="http://2skies.com/docs/c74/">lighttpd</a>
<br />

                                    <a href="http://2skies.com/docs/c68-74/">Any of these categories</a>

                -                    <a href="http://2skies.com/docs/c68+74/">All of these categories</a>
<br />
</td>
</tr>
</table>






<div class="xar-alt-outline xar-fullwidth">
    <div class="xar-accent-outline xar-fullwidth">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td align="left" valign="top" class="xar-normal">
                    <span class="xar-title"> Multiple php pools and their advantages</span>
                   <br />
                    <div align="right">
                        <span class="xar-sub">  </span>
                    </div>
                    <br />
                    <br />
                    <p><img style="margin: 0pt 0pt 6px 12px; width: 200px; float: right;" title="poolsgravity" src="assets/2skies/media/articleimages/poolsgravity.jpg" alt="poolsgravity" />Even though our preference is for Lighttpd and mod_fastcgi, these techniques will translate easily to other php-fastcgi implementations.</p>
<h3>The Problem</h3>
<p>One common problem with a busy site is performing administrative tasks, such as backing up the database, optimizing the tables, pruning posts in a forum to name a few. This is a problem because these tasks can tie up one or more php processes, thus slowing it down for everyone. Additionally, a production environment usually demands a low tolerance for &quot;timeouts,&quot; such as a web server's keep-alive timeout or php's max-execution timeout.</p>
<h3>The Solution</h3>
<p>By running muliple php pools, you can tailor each one for the task at hand. For the main pool, serving the public site to anonymous and registered members alike, you might cut down the max_execution time to 10 seconds or less, from the default ini setting of 30 seconds. In the second pool, however, you can specify a much higer timeout, like 1200 seconds (that's 20 minutes), which should provide ample time for any long running administrative task to successfully finish.</p>
<h3>lighttpd.conf</h3>
<p>Here are some of the relevant settings to use in your custom lighttpd instance:</p>
<pre class="xml">server.max-write-idle = 1200<br />fastcgi.server    = ( &quot;.php&quot; =&gt;<br />( &quot;localhost&quot; =&gt;<br />(<br />&quot;socket&quot; =&gt; &quot;/tmp/php-fastcgi-admin.socket&quot;,<br />&quot;bin-path&quot; =&gt; &quot;/usr/local/bin/php-cgi -c /home/user/etc/php-admin.ini&quot;,<br />&quot;max-procs&quot; =&gt; 1,<br />&quot;idle-timeout&quot; =&gt; 1200,<br />&quot;bin-environment&quot; =&gt; (<br />&quot;PHP_FCGI_CHILDREN&quot; =&gt; &quot;2&quot;,<br />&quot;PHP_FCGI_MAX_REQUESTS&quot; =&gt; &quot;5000&quot;),<br />&quot;broken-scriptfilename&quot; =&gt; &quot;enable&quot;<br />)<br />)<br />) <br /></pre>
<h3>php.ini</h3>
<p>Here are the relevant settings for your administrative php pool:</p>
<pre class="xml">max_execution_time = 1200     ; Maximum execution time of each script, in seconds<br />max_input_time = 60     ; Maximum amount of time each script may spend parsing request data<br />memory_limit = 64M      ; Maximum amount of memory a script may consume (128MB)<br /></pre>                    <br />
                    <span class="xar-quote">  </span>
</td>
           </tr>
       </table>
   </div>
</div>

<p>
Updated:  05 Apr 10 06:33</p>
<br />
   <table border="0" width="95%">
       <tr>
           <td align="left">
                    <a href="http://2skies.com/docs/Mirroring_with_wget">&lt;
 prev </a>
&nbsp;
           </td>
           <td align="right">
               &nbsp;
                    <a href="http://2skies.com/docs/OTRS_rewrite_rule_with_Lighttpd">
 next &gt;</a>
</td>
       </tr>
   </table>
</channel>
</rss>
