use var PHP_OPCACHE_MEMORY_CONSUMPTION for configuration (#2090)

* use var PHP_OPCACHE_MEMORY_CONSUMTION for configuration

Signed-off-by: Thomas Clavier <tom@tcweb.org>

* Use PHP_OPCACHE_MEMORY_CONSUMTION in Dockerfile-alpine.template

Signed-off-by: Thomas Clavier <tom@tcweb.org>

* fix typo : CONSUMTION -> CONSUMPTION

* Add opcache.memory_consumption documentation

* fix typo

---------

Signed-off-by: Thomas Clavier <tom@tcweb.org>
This commit is contained in:
Thomas Clavier 2025-01-17 00:31:57 +01:00 коммит произвёл GitHub
Родитель 7f707b6c5d
Коммит e0294b65ac
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -88,11 +88,12 @@ RUN set -ex; \
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
ENV PHP_MEMORY_LIMIT 512M
ENV PHP_UPLOAD_LIMIT 512M
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
RUN { \
echo 'opcache.enable=1'; \
echo 'opcache.interned_strings_buffer=32'; \
echo 'opcache.max_accelerated_files=10000'; \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
echo 'opcache.save_comments=1'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.jit=1255'; \

Просмотреть файл

@ -20,6 +20,7 @@ RUN set -ex; \
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
ENV PHP_MEMORY_LIMIT 512M
ENV PHP_UPLOAD_LIMIT 512M
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
@ -97,7 +98,7 @@ RUN { \
echo 'opcache.enable=1'; \
echo 'opcache.interned_strings_buffer=32'; \
echo 'opcache.max_accelerated_files=10000'; \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
echo 'opcache.save_comments=1'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.jit=1255'; \

Просмотреть файл

@ -300,6 +300,7 @@ Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/adm
To customize PHP limits you can change the following variables:
- `PHP_MEMORY_LIMIT` (default `512M`) This sets the maximum amount of memory in bytes that a script is allowed to allocate. This is meant to help prevent poorly written scripts from eating up all available memory but it can prevent normal operation if set too tight.
- `PHP_UPLOAD_LIMIT` (default `512M`) This sets the upload limit (`post_max_size` and `upload_max_filesize`) for big files. Note that you may have to change other limits depending on your client, webserver or operating system. Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html) for more information.
- `PHP_OPCACHE_MEMORY_CONSUMPTION` (default `128`) This sets the `opcache.memory_consumption` value. It's the size of the shared memory storage used by OPcache, in megabytes.
### Apache Configuration