5

after upgrading M2 from 2.4.2 to 2.4.5-p1 the static content deployment increased significantly.

The time to deploy increases for every new theme/language.

Used to be ~5min total for all themes to deploy, after upgrading it will take at least 2 hours?

Any idea, or suggestion, to debug which files or what is causing this?

enter image description here

2
  • To improve overall performance, Additional DB information request, please. RAM size, # cores, any SSD or NVME devices on MySQL Host server? Post TEXT data on justpaste.it and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*), sum(data_length), sum(index_length), sum(data_free) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; not SHOW STATUS, just STATUS; G) SHOW ENGINE INNODB STATUS; for server workload tuning analysis to provide suggestions. Jan 14, 2023 at 13:47
  • Post TEXT data on justpaste.it and share the links. Additional very helpful OS information includes - please, htop 1st page, if available, TERMINATE, top -b -n 1 for most active apps, top -b -n 1 -H for details on your mysql threads memory and cpu usage, ulimit -a for list of limits, iostat -xm 5 3 for IOPS by device & core/cpu count, df -h for Used - Free space by device, df -i for inode info by device, free -h for Used - Free Mem: and Swap:, cat /proc/meminfo includes VMallocUused, for server workload tuning analysis to provide suggestions. Jan 14, 2023 at 13:48

2 Answers 2

1

Since Magento 2.4.2, to speed up static content deployment, specific your theme by using --theme option and using --no-parent option when running bin/magento setup:static-content:deploy command. By doing that, Magento only generates your theme, not generate parent themes like Magento/luma, Magento/blank,...

That equals: don't run bin/magento setup:static-content:deploy without any options.

  1. For frontend: Assume your frontend theme is: TuVan/XLuma, you should run the following command for frontend:
bin/magento setup:static-content:deploy -f --area frontend --theme TuVan/XLuma --no-parent
  1. For admin:
  • Case 1: Assume you use a custom admin theme, it is TuVan/backend, you should run the following command for admin:
bin/magento setup:static-content:deploy -f --area adminhtml --theme TuVan/backend --no-parent
  • Case 2: Assume you are not using any custom admin theme, you should run the following command for admin:
bin/magento setup:static-content:deploy -f --area adminhtml

You can read more options for bin/magento setup:static-content:deploy here: https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/cli/static-view/static-view-file-deployment.html

2
  • 1
    I'm still not sure why running the deployment without any options would takes hours, when separately they all run in a few seconds.. might be server related. However your answer did help, thanks for the information. Running the deployment for our theme only with the no-parent option reduced the deployment back to just one minute.
    – Gerhard
    Jan 6, 2023 at 14:57
  • @Gerhard Glad to help. I guess your server runs out of memory for this case.
    – Tu Van
    Jan 6, 2023 at 14:59
2

Apply this patch in your project

ACSD-46815_2.4.5_v2.patch

ACSD-46815: static content deploy fails when using compact strategy

I use quick strategy, but this patch helped me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.