Skip to content

Commit e0294b6

Browse files
authored
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>
1 parent 7f707b6 commit e0294b6

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

Dockerfile-alpine.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ RUN set -ex; \
8888
# see https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#enable-php-opcache
8989
ENV PHP_MEMORY_LIMIT 512M
9090
ENV PHP_UPLOAD_LIMIT 512M
91+
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
9192
RUN { \
9293
echo 'opcache.enable=1'; \
9394
echo 'opcache.interned_strings_buffer=32'; \
9495
echo 'opcache.max_accelerated_files=10000'; \
95-
echo 'opcache.memory_consumption=128'; \
96+
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
9697
echo 'opcache.save_comments=1'; \
9798
echo 'opcache.revalidate_freq=60'; \
9899
echo 'opcache.jit=1255'; \

Dockerfile-debian.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN set -ex; \
2020
# see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
2121
ENV PHP_MEMORY_LIMIT 512M
2222
ENV PHP_UPLOAD_LIMIT 512M
23+
ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
2324
RUN set -ex; \
2425
\
2526
savedAptMark="$(apt-mark showmanual)"; \
@@ -97,7 +98,7 @@ RUN { \
9798
echo 'opcache.enable=1'; \
9899
echo 'opcache.interned_strings_buffer=32'; \
99100
echo 'opcache.max_accelerated_files=10000'; \
100-
echo 'opcache.memory_consumption=128'; \
101+
echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}'; \
101102
echo 'opcache.save_comments=1'; \
102103
echo 'opcache.revalidate_freq=60'; \
103104
echo 'opcache.jit=1255'; \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/adm
300300
To customize PHP limits you can change the following variables:
301301
- `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.
302302
- `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.
303+
- `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.
303304

304305
### Apache Configuration
305306

0 commit comments

Comments
 (0)