<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CRIN Trac: Ticket #37: Site slowdown on 8th Sept 2015</title>
    <link>https://trac.crin.org/trac/ticket/37</link>
    <description>&lt;p&gt;
The site is really slow and the number of &lt;tt&gt;php5-fpm&lt;/tt&gt; processes has gone up dramatically and so has the memory usage.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CRIN Trac</title>
      <url>https://trac.crin.org/trac/chrome/site/logo.gif</url>
      <link>https://trac.crin.org/trac/ticket/37</link>
    </image>
    <generator>Trac 1.0.2</generator>
    <item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 08 Sep 2015 13:15:23 GMT</pubDate>
      <title>attachment set</title>
      <link>https://trac.crin.org/trac/ticket/37</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;attachment&lt;/strong&gt;
                set to &lt;em&gt;crin-pingdom-2015-09-08.png&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 08 Sep 2015 13:15:41 GMT</pubDate>
      <title>attachment set</title>
      <link>https://trac.crin.org/trac/ticket/37</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;attachment&lt;/strong&gt;
                set to &lt;em&gt;crin2_2015-09-08_multips-day.png&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 08 Sep 2015 13:16:01 GMT</pubDate>
      <title>attachment set</title>
      <link>https://trac.crin.org/trac/ticket/37</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;attachment&lt;/strong&gt;
                set to &lt;em&gt;crin2_2015-09-08_multips_memory-day.png&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 08 Sep 2015 13:16:28 GMT</pubDate>
      <title>attachment set</title>
      <link>https://trac.crin.org/trac/ticket/37</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;attachment&lt;/strong&gt;
                set to &lt;em&gt;crin2_2015-09-08_phpfpm_memory-day.png&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 08 Sep 2015 13:16:41 GMT</pubDate>
      <title>attachment set</title>
      <link>https://trac.crin.org/trac/ticket/37</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;attachment&lt;/strong&gt;
                set to &lt;em&gt;crin2_2015-09-08_phpfpm_status-day.png&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 08 Sep 2015 13:16:54 GMT</pubDate>
      <title>attachment set</title>
      <link>https://trac.crin.org/trac/ticket/37</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;attachment&lt;/strong&gt;
                set to &lt;em&gt;crin2_2015-09-08_php_opcache_memoryusage-day.png&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 08 Sep 2015 13:21:12 GMT</pubDate>
      <title>hours changed; totalhours set</title>
      <link>https://trac.crin.org/trac/ticket/37#comment:1</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.25&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                set to &lt;em&gt;0.25&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Testing via &lt;a class="ext-link" href="http://tools.pingdom.com/fpt"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;Pingdom&lt;/a&gt; we have a 30 seconds load time for the front page (this should be 2 seconds or so):
&lt;/p&gt;
&lt;p&gt;
&lt;a style="padding:0; border:none" href="https://trac.crin.org/trac/attachment/ticket/37/crin-pingdom-2015-09-08.png"&gt;&lt;img src="https://trac.crin.org/trac/raw-attachment/ticket/37/crin-pingdom-2015-09-08.png" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
These &lt;a class="ext-link" href="https://munin.crin.org/munin/crin.org/crin2.crin.org"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;Munin graphs&lt;/a&gt; illustrate a massive increase in the number of &lt;tt&gt;php-fpm5&lt;/tt&gt; processes and a corresponding memory usage:
&lt;/p&gt;
&lt;p&gt;
&lt;a style="padding:0; border:none" href="https://trac.crin.org/trac/attachment/ticket/37/crin2_2015-09-08_multips-day.png"&gt;&lt;img src="https://trac.crin.org/trac/raw-attachment/ticket/37/crin2_2015-09-08_multips-day.png" /&gt;&lt;/a&gt;
&lt;a style="padding:0; border:none" href="https://trac.crin.org/trac/attachment/ticket/37/crin2_2015-09-08_multips_memory-day.png"&gt;&lt;img src="https://trac.crin.org/trac/raw-attachment/ticket/37/crin2_2015-09-08_multips_memory-day.png" /&gt;&lt;/a&gt;
&lt;a style="padding:0; border:none" href="https://trac.crin.org/trac/attachment/ticket/37/crin2_2015-09-08_phpfpm_memory-day.png"&gt;&lt;img src="https://trac.crin.org/trac/raw-attachment/ticket/37/crin2_2015-09-08_phpfpm_memory-day.png" /&gt;&lt;/a&gt;
&lt;a style="padding:0; border:none" href="https://trac.crin.org/trac/attachment/ticket/37/crin2_2015-09-08_phpfpm_status-day.png"&gt;&lt;img src="https://trac.crin.org/trac/raw-attachment/ticket/37/crin2_2015-09-08_phpfpm_status-day.png" /&gt;&lt;/a&gt;
&lt;a style="padding:0; border:none" href="https://trac.crin.org/trac/attachment/ticket/37/crin2_2015-09-08_php_opcache_memoryusage-day.png"&gt;&lt;img src="https://trac.crin.org/trac/raw-attachment/ticket/37/crin2_2015-09-08_php_opcache_memoryusage-day.png" /&gt;&lt;/a&gt;
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 08 Sep 2015 13:28:51 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/37#comment:2</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37#comment:2</guid>
      <description>
        &lt;p&gt;
Mori did you restart &lt;tt&gt;php5-fpm&lt;/tt&gt; on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; after deploying the new code today? If not that could explain some of the issues.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>mori</dc:creator>

      <pubDate>Tue, 08 Sep 2015 14:27:50 GMT</pubDate>
      <title></title>
      <link>https://trac.crin.org/trac/ticket/37#comment:3</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37#comment:3</guid>
      <description>
        &lt;p&gt;
Thanks for picking this up Chris. No I didn't restart php5-fpm, as I was not aware it was required.
&lt;/p&gt;
&lt;p&gt;
Can you let me know what command I should run? I'll add it to the wiki and may improve the deployment commands to restart it automatically.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 09 Sep 2015 13:10:29 GMT</pubDate>
      <title>attachment set</title>
      <link>https://trac.crin.org/trac/ticket/37</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;attachment&lt;/strong&gt;
                set to &lt;em&gt;crin-pingdom-2015-09-09.png&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 09 Sep 2015 13:28:57 GMT</pubDate>
      <title>hours, status, totalhours changed; resolution set</title>
      <link>https://trac.crin.org/trac/ticket/37#comment:4</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/37#comment:4</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.5&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.25&lt;/em&gt; to &lt;em&gt;0.75&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
When new code is deployed the Drupal caches need flushing and memcache and php-5-fpm need restarting:
&lt;/p&gt;
&lt;pre class="wiki"&gt;sudo -i
service php5-fpm restart
service memcache restart
&lt;/pre&gt;&lt;p&gt;
The reason php5-fpm need restarting is because the opcache was set to only check that .php files have changed the first time they are access (see &lt;a href="https://trac.crin.org/trac/query?id=" title="Tickets "&gt;ticket:#comment:17&lt;/a&gt; ) however at some point it must have been changed as it is now set to check every 5 mins based on the file time stamp, in &lt;tt&gt;/etc/php5/fpm/php.ini&lt;/tt&gt; on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt;:
&lt;/p&gt;
&lt;pre class="wiki"&gt;; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
;opcache.validate_timestamps=1
opcache.validate_timestamps=1
; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
;opcache.revalidate_freq=2
opcache.revalidate_freq=300
&lt;/pre&gt;&lt;p&gt;
I think it would be safe to change &lt;tt&gt;opcache.validate_timestamps&lt;/tt&gt; to zero again if a php5-fpm restart is always done after deploying updated code.
&lt;/p&gt;
&lt;p&gt;
The speed of the site issue is now sorted:
&lt;/p&gt;
&lt;p&gt;
&lt;a style="padding:0; border:none" href="https://trac.crin.org/trac/attachment/ticket/37/crin-pingdom-2015-09-09.png"&gt;&lt;img src="https://trac.crin.org/trac/raw-attachment/ticket/37/crin-pingdom-2015-09-09.png" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Though at some point it might be worth looking at reducing the number of css and js files.
&lt;/p&gt;
&lt;p&gt;
The Munin stats were showing a dramatic reduction in MySQL traffic,  I expect this is due to more requests being cached by memcache, the memcache memory limit was also reached so I have increased it from 0.5G to 0.75G and also reduced the default number of php5-fpm processes started as there were a lot of idle ones almost all the time.
&lt;/p&gt;
&lt;p&gt;
I have opened a new ticket for me to check the Bitbucket documentation, &lt;a class="closed ticket" href="https://trac.crin.org/trac/ticket/9#comment:17" title="task: Monitor and adjust server settings after Crin1 and Crin2 server go live (closed: fixed)"&gt;ticket:9#comment:17&lt;/a&gt;, closing this ticket.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>