Performance tips for Pimcore 10.5
Under Pimcore 10.5, some additional individual adjustments can be made to the configuration, which have a positive effect on performance.
Table of contents
Adjust Pimcore settings
First make some changes to the Pimcore settings.
Adjust Environments
APP_ENV=prod
APP_DEBUG=0
PIMCORE_DEV_MODE=0
DEV_REDIS_SOCK="/var/run/redis/$PORT.sock" #6379,6380 ++
Restrict locales
Add the following code block under config/packages/translation.yaml
:
framework:
enabled_locales: ['en', 'es', 'de']
Customise Service Container Dump
Place the service container dump in a single file by adding the following code block to config/services.yaml
:
parameters:
container.dumper.inline_factories: true
Adjust PHP settings
You can also make some adjustments under PHP to improve the performance of your Pimcore instance.
Activate OPCache and JIT
opcache.enable=1
opcache.enable_cli=1
opcache.jit_buffer_size=256M
opcache.memory_consumption=256
opcache.max_accelerated_files=20000
Set up realpath cache
; maximum memory allocated to store the results
realpath_cache_size=4096K
; save the results for 10 minutes (600 seconds)
realpath_cache_ttl=600
Set up OPCache Preloading
As a web user, execute the following command:
opcache.preload_user=web-user
opcache.preload=/var/www/share/$HOST/$PROJEKT/var/cache/prod/App_KernelProdContainer.preload.php
Alternatively, as a dev user, you can execute the following command:
opcache.preload=/var/www/share/$HOST/$PROJEKT/var/cache/dev/App_KernelDevDebugContainer.preload.php
Set up Redis caching
Create a cache pool
First create a cache pool that can then be used as an object cache and full page cache. To do this, add the following code block under config/packages/$ENV/cache.yaml
:
framework:
cache:
pools:
pimcore.cache.pool:
public: true
tags: true
default_lifetime: 31536000 # 1 year
adapter: pimcore.cache.adapter.redis_tag_aware
provider: 'redis:%env(DEV_REDIS_SOCK)%'
Set up full-page caching
To use Redis as a full-page cache, now add the following code block under config/packages/$ENV/fpc.yaml:
pimcore:
full_page_cache:
enabled: true
lifetime: 120
exclude_cookie: 'pimcore_admin_sid'
exclude_patterns: '@^/test/de@'
For more information about Pimcore, see our FAQ post and our installation guide. If you have any questions or need support, please feel free to contact our service department by e-mail support@maxcluster.de or by phone +49 5251 41 41 30.