在 magento 2.4 上非常慢 setup:upgrade

Extremely slow setup:upgrade on magento 2.4

各位! 我将 Magento 2.4 Open Source 与远程 MariaDB 数据库版本 10.3 一起使用。 当我在 cli 中 运行 setup:upgrade 时,问题就开始了,在“缓存清除完成”之后完成挂起大约需要 1.5 小时。 我以为它被冻结并查看是否有任何使用 show full processlist;

的活动数据库查询

结果是运行宁这样的查询

SHOW TABLE STATUS LIKE 'captcha_log'

对于数据库中的每个 table,每次大约需要 1-10 秒。

如果我自己 运行 这个查询,我会得到以下输出:

+-----------+------+-------+----------+----+--------------+-----------+---------------+------------+---------+--------------+-------------------+-----------+----------+---------------+--------+--------------+--------------------+----------------+---------+
|Name       |Engine|Version|Row_format|Rows|Avg_row_length|Data_length|Max_data_length|Index_length|Data_free|Auto_increment|Create_time        |Update_time|Check_time|Collation      |Checksum|Create_options|Comment             |Max_index_length|Temporary|
+-----------+------+-------+----------+----+--------------+-----------+---------------+------------+---------+--------------+-------------------+-----------+----------+---------------+--------+--------------+--------------------+----------------+---------+
|captcha_log|InnoDB|10     |Dynamic   |0   |0             |16384      |0              |0           |45088768 |NULL          |2021-07-26 10:57:13|NULL       |NULL      |utf8_general_ci|NULL    |              |Count Login Attempts|0               |N        |
+-----------+------+-------+----------+----+--------------+-----------+---------------+------------+---------+--------------+-------------------+-----------+----------+---------------+--------+--------------+--------------------+----------------+---------+

完成此查询用了 10 秒! innodb_stats_on_metadata 如果默认关闭。

是我的 MariaDB 配置有问题还是我在 Magento 配置中遗漏了一些重要的东西?顺便说一句,我正在为 MariaDB 使用 Azure 数据库。

我真的很想知道如何调试此类问题。

问题已通过转移到不同的数据库解决方案得到解决。 您可以选择更昂贵的通用数据库类型(我们正在测试基本的),或者使用 MariaDB 托管小型 VM。