Answers.Body: <p><strong>This problem is not to do with CiviCRM.</strong></p>
  
  <p><del>My server defaults to using ipv6 but this is not configured. Therefore when CiviCRM tries a <code>file_get_contents('http...')</code> it is timing out. This vexed me for a while because on the command line <code>wget</code> works fine; I thought I had disabled ipv6 on the server, but turns out <code>file_get_contents</code> doesn't know about that.</del></p>
  
  <p>Sorry for the non-question! I only saw this happening with CiviCRM. FYI it is triggered by the occasional CiviCRM security checks (which ironically, I recently <a href="https://civicrm.stackexchange.com/questions/7756/access-denied-errors-by-server-itself-on-uploaded-files">asked another question about</a>). I don't know when these are triggered; but they are triggered about once a day per user and again if a Drupal user is added.</p>
  
  <h2>EDIT</h2>
  
  <p>This is not an IPv6 issue, as I originally thought. I now believe it's a problem/quirk of using <code>apache2-mpm-itk</code> as with this worker I get the problem but with the default worker I do not.</p>
  
  <p><strong>I can confirm that this is/was a bug in the Apache MPM ITK module</strong>.</p>
  
  <p>For Debian Jessie users, you can get a fix by:</p>
  
  <pre><code>deb http://mirrors.linode.com/debian/ jessie-proposed-updates main
  </code></pre>
  
  <p>into <code>/etc/apt/sources.list</code>, and then running</p>
  
  <pre><code>apt update &amp;&amp; apt install libapache2-mpm-itk
  systemctl restart apache2.service
  </code></pre>
  
  <p>Apparently this fix will make it into Jessie 8.2, too.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-14T10:46:56.303Z
Answers.LastActivityDate: 2016-01-26T11:49:49.693Z
Answers.LastEditDate: 2017-04-13T12:53:13.017Z
Answers.UserDisplayName: artfulrobot
Answers.Body: <p>I have exactly the same issue but I'm running Ubuntu. Can you be more specific about the patch to help me find it for Ubuntu? Thanks!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-08T12:49:05.777Z
Answers.Text: This would have been better as a comment, or different question as this is a Q&A format site. Ubuntu is normally ahead of Debian so it's hard to believe this is the same bug if you're on a relatively up to date version.
Answers.UserDisplayName: artfulrobot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-08T13:17:16.607Z
Answers.Text: I'm running 14.04 LTS. And I fear my mpm-itk is out of date even though it's in the main repository
Answers.UserDisplayName: Damien
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-08T13:20:55.833Z
Answers.Text: Oh yeah, https://ubuntu.pkgs.org/14.04/ubuntu-updates-universe-amd64/apache2-mpm-itk_2.4.7-1ubuntu4.15_amd64.deb.html and https://packages.debian.org/uk/jessie/apache2-mpm-itk says you're three versions behind...
Answers.UserDisplayName: artfulrobot
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-08T10:30:40.973Z
Answers.LastActivityDate: 2017-06-08T10:30:40.973Z
Answers.UserDisplayName: Damien
Body: <p>I'm finding that when I first go to a CiviCRM page in the morning there's a loading time of just over 1 minute(!)</p>
  
  <p>There are no errors (on screen, nor in apache error log, nor in Drupal's watchdog) and after this delay everything works as normal.</p>
  
  <p>Looking in firebug it's the actual page load that's stuck on client "waiting" for a full minute before it jumps to life and starts loading the zillion other requests typically needed on a CiviCRM page, which all go fast enough.</p>
  
  <p>I've tried to trigger this. Clearing Drupal caches (<code>drush cc all</code>) does not trigger it; clearing CiviCRM caches (via <code>civicrm/admin/setting/updateConfigBackend</code>) do <strong>not</strong> trigger this delay.</p>
  
  <p>However, adding a new user in Drupal <strong>does</strong> also trigger it. (Adding a new Contact in CiviCRM does <em>not</em> trigger it.)</p>
  
  <p>Any ideas?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-14T09:50:28.977Z
Comments.Text: Well my first guess was caching too (http://shouldiblamecaching.com/)
Comments.UserDisplayName: DaveFF
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-14T09:53:09.223Z
Comments.Text: lol! I'm running Xdebug profile. will report results!
Comments.UserDisplayName: artfulrobot
Tags: <performance><4.6.10>
Title: Full minute timeouts on first page load
ThreadText: # Full minute timeouts on first page load
  
  (Asked by: username_0 on 2015-12-14)
  
  I'm finding that when I first go to a CiviCRM page in the morning there's a loading time of just over 1 minute(!)
  
  There are no errors (on screen, nor in apache error log, nor in Drupal's watchdog) and after this delay everything works as normal.
  
  Looking in firebug it's the actual page load that's stuck on client "waiting" for a full minute before it jumps to life and starts loading the zillion other requests typically needed on a CiviCRM page, which all go fast enough.
  
  I've tried to trigger this. Clearing Drupal caches (`drush cc all`) does not trigger it; clearing CiviCRM caches (via `civicrm/admin/setting/updateConfigBackend`) do **not** trigger this delay.
  
  However, adding a new user in Drupal **does** also trigger it. (Adding a new Contact in CiviCRM does *not* trigger it.)
  
  Any ideas?
  
  **Tags:** performance, 4.6.10
  
  > **Comments:**
  > **username_1**: Well my first guess was caching too (http://shouldiblamecaching.com/)  
  > **username_0**: lol! I'm running Xdebug profile. will report results!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2015-12-14. Score: 4 | Accepted answer
  
  This problem is not to do with CiviCRM.
  My server defaults to using ipv6 but this is not configured. Therefore when CiviCRM tries a file_get_contents('http...') it is timing out. This vexed me for a while because on the command line wget works fine; I thought I had disabled ipv6 on the server, but turns out file_get_contents doesn't know about that.
  Sorry for the non-question! I only saw this happening with CiviCRM. FYI it is triggered by the occasional CiviCRM security checks (which ironically, I recently asked another question about). I don't know when these are triggered; but they are triggered about once a day per user and again if a Drupal user is added.
  EDIT
  This is not an IPv6 issue, as I originally thought. I now believe it's a problem/quirk of using apache2-mpm-itk as with this worker I get the problem but with the default worker I do not.
  I can confirm that this is/was a bug in the Apache MPM ITK module.
  For Debian Jessie users, you can get a fix by:
  deb http://mirrors.linode.com/debian/ jessie-proposed-updates main
  
  into /etc/apt/sources.list, and then running
  apt update && apt install libapache2-mpm-itk
  systemctl restart apache2.service
  
  Apparently this fix will make it into Jessie 8.2, too.
  
  
  ---
  
  ### Answer by username_2 on 2017-06-08. Score: 0
  
  I have exactly the same issue but I'm running Ubuntu. Can you be more specific about the patch to help me find it for Ubuntu? Thanks!
  
  > **Comments:**
  > **username_0**: This would have been better as a comment, or different question as this is a Q&A format site. Ubuntu is normally ahead of Debian so it's hard to believe this is the same bug if you're on a relatively up to date version.  
  > **username_2**: I'm running 14.04 LTS. And I fear my mpm-itk is out of date even though it's in the main repository  
  > **username_0**: Oh yeah, https://ubuntu.pkgs.org/14.04/ubuntu-updates-universe-amd64/apache2-mpm-itk_2.4.7-1ubuntu4.15_amd64.deb.html and https://packages.debian.org/uk/jessie/apache2-mpm-itk says you're three versions behind...  
  
  ---
  
  