#1807662: Built-in APCu support in core (PHP 5.5 only) adds APC as a cache backend in core, and of course, a test for it.
The test class implements checkRequirements() already in order to prevent it from running when APC is not enabled, too old, or when the test is executed from PHP CLI (run-tests.sh) but apc.enable_cli is disabled.
However, checkRequirements() actually leads to a failing test case, and does not cause a test to be skipped.
I wonder whether we could enable apc.enable_cli on the d.o testbots to have the test executed as part of the core test suite?
Technically, I don't see why that should cause problems. But if it does, we could inject an enforced cache flush into run-tests.sh to make sure it doesn't run on stale data.
Comment | File | Size | Author |
---|---|---|---|
#18 | rfay_screenshot 2012-10-16 at 7.23.08 AM.png | 103.73 KB | rfay |
#18 | phpinfo_cli.txt | 28.5 KB | rfay |
Comments
Comment #1
rfayI don't see why not. Will try to do this when I increase APC memory for #1808260: Turn off testbot access logging and increase APC space
Comment #2
andypostThere was a lot of troubles with accelerators, suppose it needs additional step in testing after applying new patch to clean-up apc cache
Comment #3
rfayThis change is deployed on #654. Let's see if it causes any trouble. (I just copied the new apc.ini up there and restarted apache)
Committed in http://drupalcode.org/project/drupaltestbot-puppet.git/commitdiff/9d0f472
Comment #4
sunThe ini setting is "apc.enable_cli" though:
http://php.net/manual/en/apc.configuration.php#ini.apc.enable-cli
Comment #5
rfayWhoops, sorry. Glad SOMEBODY is paying attention!
http://drupalcode.org/project/drupaltestbot-puppet.git/commitdiff/769e3e41
Deployed on #654 and #813
Comment #6
sunYay! ;)
Hm. Looks like the redeployment caused those two bots to stalemate while they were busy testing patches?
654 Enabled - Reviewing
tim.plunkett's sandbox: VDC - vdc
Environment: 2
48 min 14 sec (Thu, 10/11/2012 - 03:24:03)
813 Enabled - Reviewing
bundle-registration-1786990-21.patch
Environment: 1
49 min 15 sec (Thu, 10/11/2012 - 03:23:02)
(essentially waiting for results that won't ever come back, I guess)
Comment #7
sunI sent the two bots for client re-test, and also requested a re-test for the two stale tests afterwards. Hope that resolves it.
Comment #8
andypostI see no visual speed-up on the bots with apc
Comment #9
sunThat's expected. Performance is not the reason for enabling apc.enable_cli.
In fact, enabling APC on CLI might actually slow down run-tests.sh in a minimal way, since a new cache is created and destroyed in memory for every PHP process that runs (and run-tests.sh spawns a new process for each test case class).
I'll try to re-test the APC cache backend patch manually on QA until it hits one of the bots that has it enabled and will report back whether it worked.
Comment #10
rfayAny reason we shouldn't deploy this on the remaining testbots?
Comment #11
podarokany reason for enabling this without testing alternatives (FE that is much more preffered xcache for example with integrated single caching storage for duplicated files)
Comment #12
rfay@podarok, this isn't about which PHP cache to use. We've been using APC for years and years. This is about changing one apc setting.
Comment #13
sunI've monitored the test results of the two affected bots in the past days and didn't see any problems.
So yeah, let's deploy to the others. :)
Comment #14
sunThat said, for full disclosure, the APC cache backend patch actually failed with a fatal error, which I can't reproduce locally. I wasn't able to determine the cause for it yet, but I guess it must rather be something with the patch.
Comment #15
rfayLet's wait to deploy until we see what your take on that is... Monday maybe.
Comment #16
rfayDeployed on all
Comment #17
sunAhem, sorry, I don't know why I didn't look at the review log right when I mentioned the error... stupid me ;)
So the extension cannot be loaded, since there's a header/symbol mismatch for PCRE.
Searching the net for that error shows plenty of results, commonly talking about
1) PCRE is bundled with PHP 5.3.0+ and should be always enabled -- but custom builds may have force-disabled it.
2) APC binary might have been built with wrong PHP headers or wrong PHP version (are there multiple PHP installs on testbots?)
http://forum.nginx.org/read.php?3,153213
http://serverfault.com/questions/337575/apc-does-not-load-when-calling-p...
http://forums.freebsd.org/showthread.php?t=26850 (somewhat Drupal-related)
http://atomicorp.com/forums/viewtopic.php?f=2&t=4025
Based on these threads, APC should actually not work for Apache either - you'll most likely find PHP startup errors in Apache's error.log.
That's not related or caused by the new apc.enable_cli setting though.
Comment #18
rfayApache is not having any trouble at startup; a view of the phpinfo looks sane. This is 654, the only one I looked at. Maybe you can tell me how to recreate the issue you show.
php -r "phpinfo();" works fine; attached.
Edit: I do note that php-apc is not listed in the pinned files for php5.3.5, so it's possible we're getting php-apc from Debian and php5-* from dotdeb. The bit we've done by putting the php5.3.5 packages (from dotdeb) into our own repo could easily cause this kind of behavior.
Comment #19
rfay@sun, all I need is a way to recreate this and I'll get the correct package and fix this issue. If you need access to a testbot I'll set one up for you. Although, as knowledgable as you are on this whole subject, I sure hope you have your own in a virtual machine or something. Creating a drupal testbot explains how.
Comment #20
rfayShould I assume this is no longer important?
Comment #21
catchI just opened a duplicate #2250211: Enable apc.enable_cli for core APC cache backend tests because that issue is actively being worked on again.
Comment #22
sunWe should additionally adjust PIFR (or run-tests.sh directly in core?) to force-flush the entire APC cache prior to every test run.
— Otherwise, it's pretty much guaranteed that we'll run into major APC hiccups: The external storage will either run out of space, or random test failures due to a lack of uniqueness and/or test entries that weren't cleaned up due to fatal errors.
Comment #23
rfayI'll leave this alone until you say exactly what you want, and do the issue to adjust pifr or run-tests.sh.
Comment #24
catchIf we going to flush the cache globally, we should do it in run-tests.sh. That's not a bot-specific problem.
Comment #25
Anonymous (not verified) CreditAttribution: Anonymous commenteddiscussed this with catch, sun, berdir et al in IRC:
- we don't need to worry about cli APC cache, because it doesn't survive the test run
- as long as the prefix used in the APC backend is random across tests, we don't need to worry about 'leakage' between runs
- we do need to care about the APC cache getting too large over time. not with the APCu backend patch, but later on when it becomes the default and it is used for webtests. even if we write our code to clean up after itself, bugs/fatals etc will eventually eat up the available memory
summary:
- enabling APCu for cli to unblock #1807662: Built-in APCu support in core (PHP 5.5 only) should be safe in the short term
- we will need some sort of garbage collection on bots to handle the APCu cache in the medium term
a question for rfay/jthorson:
- can we schedule an apache restart every N test runs? that would effectively remove any leftovers...
Comment #26
catchIf the bots use standard logrotate for apache, it'll get restarted whenever that happens anyway, so might not be necessary to do it explicitly.
Comment #27
rfayI think we've had a restart after every test in there for a long time.
Comment #28
Anonymous (not verified) CreditAttribution: Anonymous commentedok, then i think we're good to go :-)
we just need apc enabled for cli, and #1807662: Built-in APCu support in core (PHP 5.5 only) will be unblocked.
http://us2.php.net/manual/en/apc.configuration.php#ini.apc.enable-cli
Comment #29
rfayThis is enabled on #1883. (and puppet is stopped there)
Comment #31
rfayThis is pushing out to all testbots now.
Comment #32
catchThanks!