-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed incorrect memory_limits according to DevDocs #24533
Fixed incorrect memory_limits according to DevDocs #24533
Conversation
Hi @DavidLambauer. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @torhoehn, thank you for the review.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @DavidLambauer,
AFAIK 2G is recommended value because of CLI scripts, crons, etc, but lower 756 mb for web requests.
@akaplya could you confirm that?
This should not get approved please, also see: #24157 & magento/devdocs#739 :) |
@hostep can't follow your arguments. Currently, the code and the docs distinguish. If it is recommended to have separate values for either cli and fpm, then this should be configured correctly within the nginx.sample/.htaccess and the .user.ini files. Giving hardware recommendations might be a topic that can be discussed a lot. Nevertheless, the current values don't align with the docs. IMHO: M2 needs to have 2G at least. |
Please show me a feature in a non-modified Magento which uses 2 GB of memory? As already mentioned in the linked tickets, there is currently no suggestion for a That See php docs:
Trust me, there are a lot of poorly written php in the magento universe (not saying Magento core, but things I've seen in 3rd party code for example, or my own for that matter). |
Hi @ihor-sviziev, if you're correct, we would need to update the .user.ini to use 2G at least. .user.ini and .htaccess/nginx.conf can have different impacts. |
@DavidLambauer: does the
As far as I'm aware, the value for the cli is taken from the |
We're talking about 2 different ini-loading mechanisms. The default php-cli stuff evaluates the global php.ini. Furthermore php's default settings say, that a .user.ini will be evaluated as well. For example: if you're running For PHP-FPM usage, the global php-fpm.ini will be used (Often the same as the cli ini). Farther, additional configurations can be set either via nginx.config or via .htaccess (depending on your webserver). Summarized: The The As far as I know, Magento recommends to point the document root to pub/ instead of root. Not sure, when you want to make use of the |
Thanks for the elaborate feedback!
Can you show how or why this happens? Does this depend on a certain setup? Because I'm not seeing this? I've tested by putting some |
Alrighty, so I did some tests 😜: I have a local setup (php-fpm) with the default
My document root is pointed to As I am using nginx, any .htaccess files won't have any effect. After pointing my browser to my test instance, I receive Changing the params in the Changing the params in Changing the params in Deleting the This leads me to the following statements: Magento has two types of document roots:
Having two document roots explains the necessity for having duplicate The specified values in the In the @hostep You're absolute right that the The whole research would still end up in this PR. As @hostep and I just researched: There is nothing that effects the compilation of static assets via cli. Therefore, we only talk about the use of the |
Awesome research!
Sorry to keep nagging about this, but why should it be 2 GB for webserver requests? |
Basically, I am not able to share a profiler output or so. Getting valid results for memory use in PHP is quite hard I guess. Also, memory usage depends on a specific request. This PR is based upon two assumptions: #1: I tend to support bigger M2 installations with a couple of stores, lots of products, customers and data. Increasing the memory_limit was always necessary in order to have a performant site. #2: DevDocs recommendation |
That's super weird, it should not have any influence on the performance of a shop? It's just an upper limit. Unless there is some code in Magento explicitly checking this value and then behaving differently based on the value? Can't seem to find that at a first glance?
Most of our shops are running with only Hence my hesitation to get this merged, because 2GB is kind of ridiculous in my opinion 😉 |
Hi @DavidLambauer and @hostep , Thank you both for contribution and productive discussion! I just double checked and see that in both links links in DevDocs you can see that memory_limit should be defined 2G in https://devdocs.magento.com/guides/v2.3/install-gde/trouble/php/tshoot_php-set.html https://devdocs.magento.com/guides/v2.3/install-gde/prereq/php-settings.html As @hostep already said - current limit is already high enough and should not cause any issues. If you have any steps to reproduce where higher limit is required - please report separate issue with exact steps to reproduce. Also if you think it's not good enough documented - feel free to create issue or PR in devdocs. You can suggest any change to https://github.com/magento/devdocs/ repo. I'm closing this PR. |
Hi @DavidLambauer, thank you for your contribution! |
This DevDocs recommends a PHP
memory_limit
setting of at least 2G.This DevDocs also say, that there should be at least 2G for running M2 properly.
There has been an issue (#11322) which was closed a while ago without solving the issue.
Therefore, this pull request raises the limit of the default
memory_limit
.