【问题标题】:Magento - Too many connectionsMagento - 连接太多
【发布时间】:2014-03-07 04:15:40
【问题描述】:

我收到来自 Magento 的 Too many connections 错误。 我已将max_connection 增加到 1000,但我仍然收到错误消息。 我联系了托管服务提供商,他们让我使用命令 show processlist; 并检查我的编码。

当我运行命令时,我只看到很少的活动连接(大约 4 到 5 个连接)。因此,我不知道如何解决这个问题。

我已将 max_connection 增加到 1500,我现在收到 create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug 错误。

谁能帮我解决这种情况? 我很感激你的帮助和时间。

这是我的.cnf

key_buffer = 384M

max_allowed_packet = 1M

table_cache = 1024

sort_buffer_size = 2M

read_buffer_size = 2M

read_rnd_buffer_size = 8M

myisam_sort_buffer_size = 64M

thread_cache_size = 16

query_cache_type = 1

query_cache_size = 48M

log_slow_queries=/var/log/mysqld.slowquery.log

max_connections=1000

wait_timeout=120

tmp_table_size = 64M

max_heap_table_size = 64M

innodb_buffer_pool_size = 2048M

innodb_additional_mem_pool_size = 20M

open_files_limit=34484
#

这是显示进程列表

+-------+-----------+-----------+--------------------+----------------+-------+--------------------+------------------+
| Id    | User      | Host      | db                 | Command        | Time  | State              | Info             |

+-------+-----------+-----------+--------------------+----------------+-------+--------------------+------------------+

|  4729 | root      | localhost | abc_def| Sleep          | 13093 |                    | NULL             |

| 16282 | eximstats | localhost | eximstats          | Sleep          |    84 |                    | NULL             |

| 16283 | DELAYED   | localhost | eximstats          | Delayed insert |    84 | Waiting for INSERT |                  |

| 16343 | root      | localhost | NULL               | Query          |     0 | NULL               | show processlist |

+-------+-----------+-----------+--------------------+----------------+-------+--------------------+------------------+
4 rows in set (0.00 sec)

【问题讨论】:

  • 只是一个不值得真正回答的建议——切换到像 Nexcess 这样的 Magento 感知主机。 Magento 的性能配置文件超出了标准共享托管服务提供商的服务器设置的正常范围。
  • 可能是您的服务器无法运行 Magento。因此,只需使用具有良好配置的专用服务器..

标签: mysql magento connection


【解决方案1】:

您可以增加最大连接数,但数量有限

本质上是有太多的连接正在启动,或者没有关闭

所以你可以

  1. 增加最大连接数以允许启动更多连接
  2. 减少 wait_timeout 以重新释放已消失的连接
  3. 调查所有这些连接请求来自哪里? (通常可能是机器人,或者可能同时是机器人,一些索引更新或其他 cronjob 等)

谢谢,希望对你有帮助

【讨论】:

    猜你喜欢
    • 2013-01-31
    • 2011-07-13
    • 2013-05-09
    • 2018-08-04
    • 2017-12-27
    • 2011-03-05
    • 2014-07-22
    • 2020-08-05
    • 1970-01-01
    相关资源
    最近更新 更多