Since we upgraded Magento to 2.4.5-P1 and moved to MariaDB 10.4 (now 10.4.28) and PHP 8.1, we are facing really slow saving of products in admin. Everything else is fast, like the frontend, and working in the admin area. This is only related to saving products.

This worked flawless before, and we haven't made any other changes at all to the server or the software, like adding new extensions.

We have enabled SQL slow log, but that ain't giving us any clues, nothing is logged when saving.

Any help on this would be greatly appreciated.

Thank you,

--==UPDATE #1==--

I think this issue has something to do with MariaDB 10.4.28, and/or PHP 8.1, as nothing else has changed on the server. Either i misconfiguration of MariaDB, or an extension incompatible with PHP 8.1.

This is my current MariaDB 10.4.28 configuration, tuned with mysqltuner:

binlog_cache_size               = 16M
expire_logs_days                = 30
open_files_limit                = 32768
table_open_cache                = 64M
table_definition_cache          = 8192
net_retry_count                 = 16384
key_buffer_size                 = 6M
max_allowed_packet              = 64M
max_heap_table_size             = 768M
tmp_table_size                  = 196M
query_cache_type                = 0
query_cache_size                = 0
long_query_time                 = 0.5
innodb_buffer_pool_size         = 512M
innodb_log_file_size            = 64M
innodb_log_buffer_size          = 16M
innodb_write_io_threads         = 8
innodb_read_io_threads          = 8
innodb_autoinc_lock_mode        = 2
innodb_buffer_pool_instances    = 2

optimizer_switch                    = "rowid_filter=off"
optimizer_use_condition_selectivity = 1
join_buffer_size                    = 2M
performance_schema                  = ON
  • 1
    Try disabling any custom modules and try again. Look up the logs if there is some error happening. Mar 9 at 11:09
  • 1
    I would double check slow query log is working. Set long_query_time to 0 and verify you see results appended to the log.
    – danronmoon
    Mar 15 at 13:25

2 Answers 2


set this MariaDB settings

optimizer_use_condition_selectivity = 1

see https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/prerequisites/database-server/mysql.html as source

  • Thanks for your input, I already had these two lines in MariaDB.
    – Aknot
    Mar 10 at 9:35

Slow product save in Magento 2 can be caused by several factors. Here are a few things you can try to troubleshoot the issue:

  1. Check PHP settings: Make sure your PHP configuration settings are properly configured for Magento 2. You can check and adjust settings in php.ini file like memory_limit, max_execution_time, post_max_size, upload_max_filesize, and more.
  2. Check MariaDB configuration: Check your MariaDB configuration file my.cnf to ensure that the settings are properly configured for Magento 2. You can check and adjust settings like innodb_buffer_pool_size, innodb_log_file_size, max_allowed_packet, and more.
  3. Reindex your data: Reindexing your Magento data can often help to speed up the product save process. You can reindex data by running the following command from the Magento root directory: php bin/magento indexer:reindex.
  4. Check for third-party extension conflicts: Disable any third-party extensions that you have installed to see if they are causing the issue. You can do this by running the following command from the Magento root directory: php bin/magento module:disable [extension_name].
  5. Check server logs: Check your server logs for any errors or warnings related to the product save process. This can help to pinpoint the issue.
  6. Enable Magento developer mode: Enable Magento developer mode to see any errors or warnings that may be occurring during the product save process. You can enable developer mode by running the following command from the Magento root directory: php bin/magento deploy:mode:set developer.
  7. Upgrade to the latest Magento version: If none of the above solutions work, consider upgrading to the latest version of Magento, as it may have improvements that will help speed up the product save process.

I hope this helps you to troubleshoot the issue.

  • Thank you, I've already checked all these tips, except No. 4. Maybe a third-party extension isn't compatible with PHP 8.1. No error messages what so ever. We are using mostly Amasty, and all of them are updated.
    – Aknot
    Mar 10 at 9:38

Your Answer

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

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