-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add info about optimized realpath_cache_settings #7939
Changes from 5 commits
4449c50
200ec4e
a43322e
1de799b
6c3246a
ae9bca2
07b408d
39c70cc
68b63c2
adadd7b
58d4955
8fd265d
f2ae8e1
019fbdf
adfb983
e0e63be
5f8aca1
77f9c43
b810dd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,7 +16,7 @@ type: php:<version> | |||||
|
||||||
### PHP extensions | ||||||
|
||||||
You can enable additional PHP extensions in the `runtime:extension` section. Also, the extensions specified become available in the Docker PHP containers. | ||||||
You can enable or disable PHP extensions in the `runtime:extension` section. Also, the extensions specified become available in the Docker PHP containers. | ||||||
|
||||||
> .magento.app.yaml | ||||||
|
||||||
|
@@ -41,96 +41,19 @@ php -m | |||||
|
||||||
For details about a specific PHP extension, see the [PHP Extension List](https://www.php.net/manual/en/extensions.alphabetical.php). | ||||||
|
||||||
{{site.data.var.ece}} supports the following extensions: | ||||||
The following table shows the supported PHP extensions when deploying {{site.data.var.ee}} on the Cloud platform. | ||||||
|
||||||
- Default extensions: | ||||||
- `bcmath` | ||||||
- `bz2` | ||||||
- `calendar` | ||||||
- `exif` | ||||||
- `gd` | ||||||
- `gettext` | ||||||
- `intl` | ||||||
- `mysqli` | ||||||
- `pcntl` | ||||||
- `pdo_mysql` | ||||||
- `soap` | ||||||
- `sockets` | ||||||
- `sysvmsg` | ||||||
- `sysvsem` | ||||||
- `sysvshm` | ||||||
- `opcache` | ||||||
- `zip` | ||||||
- **Required extensions** install automatically and cannot be removed. | ||||||
- **Default extensions** install by automatically. You can disable them as needed. | ||||||
meker12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- **Optional extensions**–You can add or disable these extensions as needed. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line uses an emdash and the others don't. Maybe can match with something like:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed these headings |
||||||
|
||||||
- Extensions that are installed and cannot be uninstalled: | ||||||
- `ctype` | ||||||
- `curl` | ||||||
- `date` | ||||||
- `dom` | ||||||
- `fileinfo` | ||||||
- `filter` | ||||||
- `ftp` | ||||||
- `hash` | ||||||
- `iconv` | ||||||
- `json` | ||||||
- `mbstring` | ||||||
- `mysqlnd` | ||||||
- `openssl` | ||||||
- `pcre` | ||||||
- `pdo` | ||||||
- `pdo_sqlite` | ||||||
- `phar` | ||||||
- `posix` | ||||||
- `readline` | ||||||
- `session` | ||||||
- `sqlite3` | ||||||
- `tokenizer` | ||||||
- `xml` | ||||||
- `xmlreader` | ||||||
- `xmlwriter` | ||||||
|
||||||
- Extensions that can be installed and uninstalled as needed: | ||||||
- `bcmath` | ||||||
- `bz2` | ||||||
- `calendar` | ||||||
- `exif` | ||||||
- `gd` | ||||||
- `geoip` | ||||||
- `gettext` | ||||||
- `gmp` | ||||||
- `igbinary` | ||||||
- `imagick` | ||||||
- `imap` | ||||||
- `intl` | ||||||
- `ioncube` | ||||||
- `ldap` | ||||||
- `mailparse` | ||||||
- `mcrypt` | ||||||
- `msgpack` | ||||||
- `mysqli` | ||||||
- `oauth` | ||||||
- `opcache` | ||||||
- `pdo_mysql` | ||||||
- `propro` | ||||||
- `pspell` | ||||||
- `raphf` | ||||||
- `recode` | ||||||
- `redis` | ||||||
- `shmop` | ||||||
- `soap` | ||||||
- `sockets` | ||||||
- `sodium` | ||||||
- `ssh2` | ||||||
- `sysvmsg` | ||||||
- `sysvsem` | ||||||
- `sysvshm` | ||||||
- `tidy` | ||||||
- `xdebug` | ||||||
- `xmlrpc` | ||||||
- `xsl` | ||||||
- `yaml` | ||||||
- `zip` | ||||||
- `pcntl` | ||||||
| Default extensions | Required extensions | Optional extensions | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required Extension list has been repeated in the Default Extensions list There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -Redid the table to begin with required extensions, followed by default and optional extensions. I also removed the default extensions from the optional list, and updated the Optional descriptions summary to state that the default extensions can be disabled.- There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afraid the list is still incorrect. (https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hostep I updated the PHP settings topic to add a note about the ext-sockets extension that was in the 2.3 version of the topic:
In the php-settings topic, the list of required extensions is generated in this file: https://github.com/magento/devdocs/blob/master/src/_includes/install/php-extensions-template.md, but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I restored the original content from this topic. I realized that I was conflating enable and disable extensions with install and uninstall. In the .magento.app.yaml file, which is the subject of this topic, you only enable and disable extensions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @meker12: we already kind-of had an issue for this, but it was closed unfortunately: #7568 (comment), should I create a new issue for this? I know colleagues of yours are already aware of the issue for many months (internal ticket DOC-80), but maybe we need an official public ticket to track this, otherwise it might be forgotten... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hostep Thanks for the context about the ext-sockets extension. It's useful that the current guide now includes a specific mention of the ext-sockets extension, and why you need it. Will follow up on our internal ticket to understand the best information to provide about this extension. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hostep the DOC-80 is closed. It was mostly focused on the Packages topics. As it appeared, it's impossible to get accurate information about PHP versions from the Composer files. I hope that it is still possible for the list of extensions. Please open an issue for this with your recent suggestions (#7568, #7398) and assign it to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dshevtsov, done: #7960 (but I can't assign you) |
||||||
|--------------------|---------------------|---------------------| | ||||||
| `ctype`<br> `curl`<br> `date`<br> `dom`<br> `fileinfo`<br> `filter`<br> `ftp`<br> `hash`<br> `iconv`<br> `json`<br> `mbstring`<br> `mysqlnd`<br> `openssl`<br> `pcre`<br> `pdo`<br> `pdo_sqlite`<br> `phar`<br> `posix`<br> `readline`<br> `session`<br> `sqlite3`<br> `tokenizer`<br> `xml`<br> `xmlreader`<br> `xmlwriter`<br> | `ctype`<br> `curl`<br> `date`<br> `dom`<br> `fileinfo`<br> `filter`<br> `ftp`<br> `hash`<br> `iconv`<br> `json`<br> `mbstring`<br> `mysqlnd`<br> `openssl`<br> `pcre`<br> `pdo`<br> `pdo_sqlite`<br> `phar`<br> `posix`<br> `readline`<br> `session`<br> `sqlite3`<br> `tokenizer`<br> `xml`<br> `xmlreader`<br> `xmlwriter`<br> | `bcmath`<br> `bz2`<br> `calendar`<br> `exif`<br> `gd`<br> `geoip`<br> `gettext`<br> `gmp`<br> `igbinary`<br> `imagick`<br> `imap`<br> `intl`<br> `ioncube`<br> `ldap`<br> `mailparse`<br> `mcrypt`<br> `msgpack`<br> `mysqli`<br> `oauth`<br> `opcache`<br> `pdo_mysql`<br> `propro`<br> `pspell`<br> `raphf`<br> `recode`<br> `redis`<br> `shmop`<br> `soap`<br> `sockets`<br> `sodium`<br> `ssh2`<br> `sysvmsg`<br> `sysvsem`<br> `sysvshm`<br> `tidy`<br> `xdebug`<br> `xmlrpc`<br> `xsl`<br> `yaml`<br> `zip`<br> `pcntl`<br> | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is best to clarify here. I don't know why any extension from the Required column would be duplicated anywhere else because you note that they cannot be removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restored original column headings. My proposed updates didn't make sense. |
||||||
|
||||||
{:.bs-callout-warning} | ||||||
PHP compiled with debug is not supported and the Probe may conflict with XDebug or XHProf. Disable those extensions when enabling the Probe. The Probe conflicts with some PHP extensions like Pinba or IonCube. | ||||||
|
||||||
### Custom PHP configuration | ||||||
|
||||||
You can customize the PHP settings for a Cloud environment by adding a `php.ini` file to your project. See [Customize PHP.INI]({{ site.baseurl }}/cloud/project/magento-app-php-ini.html). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,22 +6,46 @@ functional_areas: | |
- Setup | ||
- Application | ||
--- | ||
You can also create and push a `php.ini` file that is appended to the configuration maintained by {{site.data.var.ee}}. | ||
|
||
In your repository, the `php.ini` file should be added to the root of the application (the repository root). | ||
You can customize the PHP settings for your environment using a `php.ini` file that is appended to the configuration maintained by {{site.data.var.ee}}. | ||
|
||
In your repository, add the `php.ini` file to the root of the application (the repository root). | ||
|
||
{:.bs-callout-info} | ||
Configuring PHP settings improperly can cause issues. We recommend only advanced administrators set these options. | ||
|
||
For example, if you need to increase the PHP memory limit: | ||
## Increase PHP memory limit | ||
|
||
```bash | ||
To increase the PHP memory limit, add the following setting to the php.ini file: | ||
meker12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```php | ||
memory_limit = 756M | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our support site is recommending something different. Is 756 the minimum? I know I have seen different values for this, and mine is set to 2G. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
``` | ||
|
||
For a list of recommended PHP configuration settings, see [Required PHP settings]({{ site.baseurl }}/guides/v2.3/install-gde/prereq/php-settings.html). | ||
## Optimize realpath_cache configuration | ||
|
||
Set the following `realpath_cache` settings to improve Magento performance. | ||
|
||
```conf | ||
; | ||
; Increase realpath cache size | ||
; | ||
realpath_cache_size = 1M | ||
meker12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
; | ||
; Increase realpath cache ttl | ||
; | ||
realpath_cache_ttl = 7200 | ||
``` | ||
|
||
These settings allow PHP processes to cache paths to files instead of looking them up each time a page loads. See [Performance Tuning](https://www.php.net/manual/en/ini.core.php) in the PHP documentation. | ||
|
||
{:.bs-callout-info} | ||
For a list of recommended PHP configuration settings, see [Required PHP settings]({{ site.baseurl }}/guides/v2.4/install-gde/prereq/php-settings.html). | ||
|
||
## Check custom php.ini settings | ||
|
||
After pushing your file, you can check that the custom PHP configuration has been added to your environment by [creating an SSH tunnel]({{ site.baseurl }}/cloud/env/environments-start.html#env-start-tunn) to your environment and entering: | ||
After pushing the `php.ini` changes to your Cloud environment, you can check that the custom PHP configuration has been added to your environment by [creating an SSH tunnel]({{ site.baseurl }}/cloud/env/environments-start.html#env-start-tunn) to your environment and entering: | ||
|
||
```bash | ||
cat /etc/php5/fpm/php.ini | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,14 +73,23 @@ PHP Warning: date(): It is not safe to rely on the system's timezone settings. | |
- Installing and updating Magento components from Magento Marketplace, `2G` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can probably be removed now that the web set up wizard was removed in Magento 2.4.0? |
||
- Testing, `~3-4G` | ||
|
||
- Increase the values for the PHP `realpath_cache_size` and `realpath_cache_ttl` to recommended settings: | ||
|
||
```conf | ||
realpath_cache_size=1M | ||
meker12 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
realpath_cache_ttl=7200 | ||
``` | ||
|
||
These settings allow PHP processes to cache paths to files instead of looking them up each time a page loads. See [Performance Tuning](https://www.php.net/manual/en/ini.core.php) in the PHP documentation. | ||
|
||
- Enable [`opcache.save_comments`](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.save-comments){:target="_blank"}, which is required for Magento 2.1 and later. | ||
|
||
We recommend you enable the [PHP OPcache](https://www.php.net/manual/en/book.opcache.php){:target="_blank"} for performance reasons. The OPcache is enabled in many PHP distributions. | ||
|
||
Magento 2.1 and later use PHP code comments for code generation. | ||
|
||
{:.bs-callout-info} | ||
To avoid issues during installation and upgrade, we strongly recommend you apply the same PHP settings to both the PHP command-line configuration and the PHP web server plug-in's configuration. For more information, see the next section. | ||
To avoid issues during installation and upgrade, we strongly recommend you apply the same PHP settings to both the PHP command-line configuration and the PHP web server plug-in configuration. For more information, see the next section. | ||
|
||
## Step 1: Find PHP configuration files {#php-required-find} | ||
|
||
|
@@ -136,6 +145,7 @@ To set PHP options: | |
``` | ||
|
||
1. Add the time zone setting you found in step 2. | ||
|
||
1. Change the value of `memory_limit` to one of the values at the beginning of this section. | ||
|
||
For example, | ||
|
@@ -144,7 +154,22 @@ To set PHP options: | |
memory_limit=2G | ||
``` | ||
|
||
1. Add or update the `realpath_cache` configuration to match the following values: | ||
|
||
```conf | ||
; | ||
; Increase realpath cache size | ||
; | ||
realpath_cache_size = 1M | ||
|
||
; | ||
; Increase realpath cache ttl | ||
; | ||
realpath_cache_ttl = 7200 | ||
``` | ||
|
||
1. Save your changes and exit the text editor. | ||
|
||
1. Open the other `php.ini` (if they are different) and make the same changes in it. | ||
|
||
## Step 3: Set OPcache options {#php-required-opcache} | ||
|
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.
So, after thinking about the following two list items, you say "add or disable" a couple of times, which seems a little weird. Add = install? And enable = ?add?. Would it be correct to say the required extensions "install and enable" automatically?
Also, you say you cannot remove it, but can you disable it?
Uh oh!
There was an error while loading. Please reload this page.
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.
It's confusing because the runtime section has two sections: extensions: and disabled:extensions
and the headings in the original topic for each section were:
It's not clear to me what is meant by install and uninstalled -- and how that relates to the runtime section.
I think the confusion is that with extensions, you can install them, and you can enable or disable them after they are installed.
Andrii also pointed out to me the default .magento.app.yaml in magento-cloud template: