I have been struggling with a timeout error in a couple of Drupal 8 sites, which I have not been able to reproduce. When I deploy them into my colleague's production server (a Mac machine), all the Drupal 8 sites are experiencing a page lock up (the browser waits indefinitely). I have not been able to reproduce the error in my machine (running Debian), neither in testing instances in other servers (e.g. a free Pantheon instance). The only clues I have for the moment are:

  • The error seems to not occur so often once I disable cron in the Drupal sites. However, if I run cron manually, I have not been able to reproduce it neither.
  • This only affects Drupal 8 sites. The rest of the sites (Drupal 7 and many others) are not affected at all.
  • The error disappears rebooting Apache. However, only when I do the following combination: "/opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop" & "/opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start"
  • My colleague suggested me to use "/opt/local/apache2/bin/apachectl graceful" , but in that case, the error does not disappear.

Any ideas on what the issue could be? I am running different versions of Drupal in the sites (8.0.2 and 8.0.5). At https://github.com/CRESS-Surrey/erie_website_code/issues/31#issuecomment... I have attached as well some captures of the http headers in a successful and unsuccessful request . I am trying to document the issues as well (more information) at that issue and https://github.com/drozas/cecan/issues/23 for the other site.

Thanks a lot!

David

Comments

bander2’s picture

What do the apache logs say?

- Brendan

drozas’s picture

This is the closest log I have from which the error has occurred (I am not able to reproduce it):

[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apc_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/vendor/symfony/class-loader/ApcClassLoader.php on line 126, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apc_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/vendor/symfony/class-loader/ApcClassLoader.php on line 126, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apc_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/vendor/symfony/class-loader/ApcClassLoader.php on line 126, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apc_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/vendor/symfony/class-loader/ApcClassLoader.php on line 126, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apc_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/vendor/symfony/class-loader/ApcClassLoader.php on line 126, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apc_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/vendor/symfony/class-loader/ApcClassLoader.php on line 126, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apcu_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/core/lib/Drupal/Core/Cache/ApcuBackend.php on line 182, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apcu_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/core/lib/Drupal/Core/Cache/ApcuBackend.php on line 182, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apcu_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/core/lib/Drupal/Core/Cache/ApcuBackend.php on line 182, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apcu_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/core/lib/Drupal/Core/Cache/ApcuBackend.php on line 182, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apcu_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/core/lib/Drupal/Core/Cache/ApcuBackend.php on line 182, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...
[Mon Apr 04 15:56:22 2016] [error] [client 90.173.246.19] PHP Warning: apcu_store(): Unable to allocate memory for pool. in /Volumes/Documents/VirtualSites/cress/cecan-dev/core/lib/Drupal/Core/Cache/ApcuBackend.php on line 182, referer: http://drupal-research.org/sites/default/files/css/css_kxDiOjKCw4TU-tb-y...

bander2’s picture

PHP Warning: apcu_store(): Unable to allocate memory for pool.

I have some experience with this :( It means that APC is out of memory. You can try increasing APCs memory. In my case APC was caching a bunch of stuff I didn't really want it to (a sandbox and staging site - which were taking up the memory). I ameliorated the problem by telling APC to not cache that stuff and monitoring APCs memory and clearing the cache when it was getting full.

In the end, the fix was upgrading PHP to 5.5 which has it's own opcode cache (if I remember correctly).

- Brendan

drozas’s picture

Thanks Brendan, I will give it a try!