Problem/Motivation
While installing D8 with a PHP memory limit set to 32MB leads to an 500(AJAX http) error. This doesn't say anything about whats going wrong while installation. We should decide on a suitable memory limit and update the requirement to that.
Proposed resolution
Change DRUPAL_MINIMUM_PHP_MEMORY_LIMIT to a minimum value where Drupal can be installed without errors
and update the simpletest memory limit.
From #35
-const DRUPAL_MINIMUM_PHP_MEMORY_LIMIT = '32M';
+const DRUPAL_MINIMUM_PHP_MEMORY_LIMIT = '64M';
-const SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT = '64M';
+const SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT = '320M';
Remaining tasks
- (done) manual testing
- (done) review
- (done) issue summary update
- maybe.. update https://www.drupal.org/requirements/php#memory (it already has a link to this issue though)
#2062057: Update PHP requirements page for Drupal 8: execution time will do the execution time.
#2295051: Display requirements warnings on module installation will look into while enabling modules.
#2289201: [Meta] Make drupal install and run within reasonable php memory limits so we can reset the memory requirements to lower levels should allow us to reduce the requirements eventually.
User interface changes
No. (No new patterns, using the requirements UI that is already in place.) See #28
API changes
No.
Comment | File | Size | Author |
---|---|---|---|
#35 | interdiff-34-35.txt | 585 bytes | xjm |
#35 | memory-2289183-35.patch | 1.95 KB | xjm |
#34 | interdiff-27-34.txt | 785 bytes | xjm |
#34 | memory-2289183-34.patch | 1.96 KB | xjm |
#28 | memory_limit_simpletest.png | 22.04 KB | xjm |
Comments
Comment #1
piyuesh23 CreditAttribution: piyuesh23 commentedComment #2
xjmSo I think there are two things we should do:
Comment #3
YesCT CreditAttribution: YesCT commentedI temporarily changed the doc https://www.drupal.org/requirements/php
It should be updated again once a number is decided.
Comment #4
catchTagging novice - patch itself should be straightforward.
Comment #5
xjmAlso let's update the issue summary to use the standard template and list the tasks. :)
Comment #6
anavarreWould something like this be enough? Or is there a need to have SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT set to an even higher value for now?
FYI, in my testing, loading the admin/config/development/testing page has proven to be painful to render with 128M (got WSODs). If did require 2 or 3 page loads to finally load it. Also, would EnvironmentTest.php have to be updated as well? I'm thinking about:
Comment #7
anavarreComment #8
xjmFor me
admin/config/development/testing
often whitescreens on a cold cache with 128 MB if I've installed Standard, but works fine on the second page load. Some of the longer-running tests have also timed out for me in the past on 128 MB. So I could go either way on that point... let's get more feedback:simpletest_requirements()
from a requirements error to a requirements warning?I think we should also add an @todo to both docblocks explaining that these are temporary minima and referencing https://www.drupal.org/node/2289201.
I considered whether we should also add a text message in the installer indicating that this is a temporary development requirement and people don't freak thinking we're going to ship requiring 128 MB. I'm on the fence about that since you can still install Drupal; you're just warned that you might need more.
Comment #9
catchI tried to find the issue where this was discussed for the installer (i.e. to handle different memory requirements of different distributions), but couldn't locate it. The short answer is 'no'.
Yes to both.
I'm OK with the embarrassment of an embarrassingly high memory requirement on the installer for now, let's not add any promises that it's going to be fixed.
Comment #10
anavarreHere's a new patch with the recommendations of #8 and #9.
Comment #11
anavarreOops. This should be better.
Comment #12
sunThe completely revised + final incarnation of #697760: Replace getInfo() in tests with native phpDoc + annotations (following PHPUnit) (not posted yet) reduces the total memory consumption for discovering tests to ~11MB (with a peak of ~32MB).
In other words, the current memory consumption for the (simple)test (UI) should be ignored for this issue.
--
Before bumping the regular memory limit from 32MB to 128MB, it would be sensible to first perform an analysis to determine what exactly causes the heavy memory consumption.
Comment #13
anavarreExcellent news. Should we wait until it has landed to make any adjustment though?
I'm very much aligned with this but we should then clarify
in #9. I'm not sure what could not be fixed with profiling and performance work and assume it's more a matter of releasing D8 sooner than later, even if that means we should have much higher requirements than we would normally find acceptable.
Comment #14
sunI think we can independently move forward here; simply remove the changes to simpletest.
I'm surprised by @catch's OK in #9. Though I could get behind it, if we already know the cause and have a plan to fix it. (which I'm not aware of)
Comment #15
anavarreOK, back to the regular SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT setting (which ATM is 64M, not 32M).
Comment #16
YesCT CreditAttribution: YesCT commentedRe #12:
We should not wait to find out why the memory usage is high.
We know it is. People installing Drupal 8 for the first time(s) think they just need what our current requirements are (they need more), and they are misled by the errors they get on a site with too little memory.
#2289201: [Meta] Make drupal install and run within reasonable php memory limits so we can reset the memory requirements to lower levels Should have a child issue that is: perform an analysis to determine what exactly causes the heavy memory consumption (or something like that.)
We can do that in that issue.
Comment #17
anavarreI just tried installing HEAD with 32M and it worked fine. Do we have any precise example of what is failing for people so that I can reproduce?
Comment #18
YesCT CreditAttribution: YesCT commented@anavarre in general: #2021029: During Install, Inform User that they have Insufficient Memory Rather than Server Error: AJAX HTTP Result Code: 500 [edit: we could ask those people for more information. what kind of info do we want to ask them for? we should also tell them how they can look up the info we ask for.]
opened #2294569: Determine cause of high memory consumption
Comment #19
anavarreAha, I think you've just brought up the perfect issue to move forward. Thanks!
In #2021029: During Install, Inform User that they have Insufficient Memory Rather than Server Error: AJAX HTTP Result Code: 500 comment #26 says that with APC on the installer works fine with 32M but as soon as it's turned off it fails. Not only it makes a great deal of sense but I was also able to reproduce this. Looks like it failed around the time it was installing the image module (step 27/38)
I'm running PHP 5.5 which means I also benefit from the built-in Zend opcode cache. I had to disable it and then it failed.
So, what I think we should focus on is people using 5.4 or 5.5 with APC or Zend opcode cache turned off. I'll ask just that in #2021029: During Install, Inform User that they have Insufficient Memory Rather than Server Error: AJAX HTTP Result Code: 500.
Comment #20
anavarreFWIW the installer works fine with 64M and Zend Opcache turned off. If we were to indeed temporary up the requirements, 64M would seem like a good compromise until #2294569: Determine cause of high memory consumption is fixed. I can't test with 5.4 but if anybody could confirm it behaves the same, that would be really helpful.
Comment #21
xjm@anavarre, can you please provide interdiffs when you upload new patches?
Minima is plural. Mimumum is the singular. :)
This change was intended to be combined with increasing the simpletest memory limit to something big; it's irrelevant without the change to the simpletest memory.
I agree with @YesCT; it doesn't make sense to postpone increasing the limit on other issues. We have a critical followup to get it back down.
Even with my local memory limit at 128 MB, it's now taking 3 page loads to load the complete test list page after installing simpletest. So +1 for #697760: Replace getInfo() in tests with native phpDoc + annotations (following PHPUnit). Note that the issue is beta deadline so would need to be done soon...
Comment #22
xjmSo, after experimenting with my dev environment a bit, I'd still recommend increasing the simpletest memory limit to 256 and referencing both the critical followup issue and perhaps sun's issue as well in @todo in the docblock.
Comment #23
anavarre@xjm: thanks for your guidance. Let me please know if there's still something I need to learn how to do better?
Comment #24
oriol_e9gIf the requeriments change when and OPCACHE is enabled Why do not use a conditional?
Comment #25
catch@sun by #9 I mean:
1. People cannot install Drupal for development now, so we should just raise the memory limit to reflect reality. No point pretending it's better than it is.
2. Similarly, let's not sugar coat how bad the memory usage is in the requirements description, if it really is 128M on some systems that is bad whether we're 'in development' or not.
3. #1744302: [meta] Resolve known performance regressions in Drupal 8 is already open for performance issues - however I do think this deserves its own dedicated critical issue. Drupal 7 memory requirements didn't really get analyzed until about a month before release. To meaningfully look at memory usage, we should be checking both the installer, and a standard (or bigger than standard) install with completely empty caches. I'd probably look at YAML discovery/parsing first.
Comment #26
anavarre@oriol_e9g: to my knowledge you can't do this: http://www.php.net/manual/en/language.constants.syntax.php
Also, for PHP 5.5, the extension check would have to be extension_loaded('Zend Opcache').
Comment #27
xjmThanks @anavarre. I think that's what we want. Sorry for all the criss-crossed recommendations. :) I just tweaked the formatting of the @todo a bit based on catch's comment and wrapped at 80 chars based on the documentation standards.
I also tested installing standard with 64 MB on MAMP with both 5.4.26 and 5.5.10, no opcode cache, and was able to get through the installer. (This wasn't true earlier in the cycle, so yay.) So until we get someone who can confirm they can't install with 64 MB on their environment, I think that makes sense as the limit we recommend.
Agreed with #25.
It's possible to define constants conditionally with define() instead of
const
. That might be worth looking into; however, it gets us into a broader discussion around whether or not the Drupal installer should respond to specific environment configurations (like the availability of APC, see #2248767: Use fast, local cache back-end (APCu, if available) for low-write caches (bootstrap, discovery, and config) for example). So maybe we can look into that in a followup issue.Comment #28
xjmTIL we don't do anything with
REQUIREMENT_WARNING
during the install phase for modules. (See in drupal_check_error()). IMO that's a bug and I might file a separate patch; a warning should at least display a dsm() IMO if you implementhook_requirements()
that way.Here's screenshots of too-low memory limits for both installing core and the status report page after installing simpletest.
Comment #29
xjmFiled #2295051: Display requirements warnings on module installation.
Comment #30
nedjoI closed #2062057: Update PHP requirements page for Drupal 8: execution time as a duplicate. While that issue was older, this one has more activity and a patch.
I updated the title to reflect the other issue's claim that max_execution_time also needs to be raised.
Comment #31
YesCT CreditAttribution: YesCT commentedlet's reuse that other issue or make a new one for the execution time.
Comment #32
YesCT CreditAttribution: YesCT commentedI did not test manually, but that was done by others here. great.
I read all the lines in the patch.
It stays in scope, is well documented with related issues, and the standards stuff is good too.
... updating the issue summary and removing Needs issue summary update tag.
not sure about change record... let's see.
Comment #33
alexpottUnfortunately this is not currently enough to render the Simpletest UI when the cache needs rebuilding. See #2307163: BrokenSetUpTest failing randomly with filling up memory. Not entirely sure what to do here.
Comment #34
xjmThis doesn't need a CR, I don't think. We've already updated https://www.drupal.org/requirements.
Context for #33: The current increase in the need for memory for the test runner UI was probably introduced with #1825952: Turn on twig autoescape by default, which is why 256 was enough before but isn't now.
@alexpott, I think we should just be honest about the current memory requirements and then reduce the number when we have addressed the issues with overall memory usage and with the SimpleTestUI.
Patch attached that changes the simpletest limit to 320 MB (which @alexpott confirmed is sufficient) and updates the @todo to remove the reference to a fixed issue and adds one to the new critical.
Leaving at RTBC; please bump back if you think the 320 number should have more discussion. :)
Comment #35
xjmAlso noticed a typo. :)
Comment #38
catchThese are fine, we can review upwards and downwards as needed, thanks for the critical follow-up to sort out the actual issues.
Committed/pushed to 8.x, thanks!
Comment #39
YesCT CreditAttribution: YesCT commented