Add igbinary as serializer for increased performance

- Install igbinary via PECL
- Enable igbinary support for memcached and redis
- Configure PHP to use igbinary for APCu and session serialization
- Update Dockerfile to include igbinary and its configuration

Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
This commit is contained in:
ernolf 2024-06-11 19:52:10 +02:00
parent cbe0a89676
commit d1ed80af33

View file

@ -78,12 +78,18 @@ RUN set -ex; \
; \
\
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install igbinary-3.2.15; \
pecl install APCu-5.1.23; \
pecl install memcached-3.2.0; \
pecl install redis-6.0.2; \
pecl install --configureoptions \
'enable-memcached-igbinary="yes"' \
memcached-3.2.0; \
pecl install --configureoptions \
'enable-redis-igbinary="yes" enable-redis-zstd="yes" enable-redis-lz4="yes"' \
redis-6.0.2; \
pecl install imagick-3.7.0; \
\
docker-php-ext-enable \
igbinary \
apcu \
memcached \
redis \
@ -99,6 +105,11 @@ RUN set -ex; \
apk add --no-cache --virtual .nextcloud-phpext-rundeps $runDeps; \
apk del .build-deps; \
\
{ \
echo 'apc.serializer=igbinary'; \
echo 'session.serialize_handler=igbinary'; \
} >> /usr/local/etc/php/conf.d/docker-php-ext-igbinary.ini; \
\
# set recommended PHP.ini settings
# see https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
{ \