...
- Always run in prod environment using:
--env=prod
- See Using environments page for further information on Symfony environments.
- See Logging & Debug configuration for some of different features enabled in development environments, which by design uses memory.
Avoid Stash (Persistence cache) using to much memory in prod:
If your system is running, or you need to use cache, then disable Stash InMemory cache as it does not limit the amount of items in cache and grows exponentially:
Code Block title ezpublish.yml (snippet, not a full example for stash config) stash: caches: default: inMemory: false
Also if you use FileSystem driver, make sure
memKeyLimit
is set to a low number, default should be 200 and can be lowered like this:Code Block title ezpublish.yml (snippet, not a full example for stash config) stash: caches: default: FileSystem: memKeyLimit: 100
If your setup is offline and cache is cold, there is no risk of stale cache and you can actually completely disable Stash cache. This will improve performance of import scripts:
Code Block title ezpublish.yml (full example) stash: caches: default: # Note: In eZ Publish 5.3 and earlier "drivers" is called "handlers" drivers: [ BlackholeBlackHole ] inMemory: false
For logging using monolog, if you use either the default
fingers_crossed
, orbuffer
handler, make sure to specifybuffer_size
to limit how large the buffer grows before it gets flushed:Code Block title config_prod.yml (snippet, not a full example for monolog config) monolog: handlers: main: type: fingers_crossed buffer_size: 200
- Run PHP without memory limits using:
php
-d memory_limit=-1 app/console <command>
- Disable
xdebug
(PHP extension to debug/profile php use) when running the command, this will cause php to use much more memory.
...