By joegl on
Whenever we install a new site we use a profile which admittedly has a lot of configuration to import and modules to enable. We are beginning to run into out of memory issues with PHP when running a fresh install. The step which takes the longest is the install_config_import_batch. When I run an install locally, this step takes about 500 seconds and 350+ MB of memory.
What are some ways we can optimize this? Is there a way to skip this config import step and run it after the installation?
Comments
Trying the optimization of the installation
"You can try a few optimizations to reduce memory usage during
install_config_import_batch. First, increasing thememory_limitinphp.inimight help handle large configurations. Another option is reducing the batch size incore/lib/Drupal/Core/Batch/BatchStorage.phpto process smaller chunks at a time, which lowers peak memory consumption. If skipping the config import during installation is feasible, you could install the site with a minimal profile and then rundrush cimafter installation to handle the import separately. Additionally, temporarily disabling non-essential modules during installation and enabling garbage collection (gc_enable()) before the batch process starts can help free up memory.Trying the optimization of the installation
Great suggestions, Himani! Increasing the
memory_limitand adjusting the batch size can definitely help manage memory consumption. Running the config import separately after installation seems like a solid approach to avoid overloading the system during the initial setup. Disabling non-essential modules and enabling garbage collection is also a smart way to free up memory. I'll give these methods a try and see how it works. Thanks for the helpful tips!Really? Cooking up some AI
Really? Cooking up some AI text to boost your site in a random open source forum?
Consider increasing PHP
Consider increasing PHP memory limit or running imports after installation.