Drupal 网站因许多连接错误而被屏蔽 - 网站离线

发布于 2024-11-14 02:26:09 字数 1122 浏览 4 评论 0原文

有时,从我们的 Drupal 6.20 系统到 Mysql 数据库的数据库连接数量达到 100-150,一段时间后网站就会离线。尝试手动连接 Mysql 时的错误消息是“由于许多连接错误而被阻止。使用 'mysqladminlush-hosts' 取消阻止”。由于数据库托管在 Amazon RDS 上,我无权发出此命令,但我可以重新启动数据库,并且重新启动后网站会再次正常工作。直到下次。

Drupal 在离线之前报告多个错误,有两种类型:

重复条目 '279890-0-all' 为密钥 “主要”查询: node_access_write_grants /* 访客: node_access_write_grants */ 插入 INTO node_access (nid, 领域, gid, 授予视图、授予更新、 grant_delete)值(279890, “全部”, 0, 1, 0, 0) 中 /var/www/quadplex/drupal-6.20/modules/node/node.module 在第 2267 行。

超过锁定等待超时;尝试 重新启动交易查询: content_write_record /* 访客 : 内容写入记录 */ 更新 内容字段评级设置 vid = 503621, nid = 503621,字段评级值 = 1212 哪里 vid = 503621 /var/www/quadplex/drupal-6.20/sites/all/modules/cck/content.module 在第 1213 行。

这两个查询中的 nid 始终相同,并且引用由自定义模块频繁自动更新的两个节点。我可以在 Apache 日志中追踪这些错误与异常多的 Web 请求之间的关联。我会理解网站会因此变得更慢。但是:

  1. 为什么会出现这些错误,以及如何解决这些错误?在我看来,这与多个网络请求试图同时更新同一节点有关。但 Drupal 肯定应该通过锁定表等来处理这个问题吗?或者我应该以某种特殊的方式处理它?<​​/p>

  2. 尽管网络负载较高,但为什么数据库完全锁定并需要重新启动?如果网站仍然可以访问 Mysql,一旦负载较低,它可以再次提供页面,不是更好吗?是否有一些设置?

谢谢你!

From time to time, the number of database connections from our Drupal 6.20 system to our Mysql database reaches 100-150 and after a while the website goes offline. The error message when trying to connect to Mysql manually is "blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'". Since the database is hosted on an Amazon RDS I don't have the permission to issue this command, but I can reboot the database and once rebooted the website works normally again. Until next time.

Drupal reports multiple errors prior to going offline, of two types:

Duplicate entry
'279890-0-all' for key
'PRIMARY' query:
node_access_write_grants /* Guest :
node_access_write_grants */ INSERT
INTO node_access (nid, realm, gid,
grant_view, grant_update,
grant_delete) VALUES (279890,
'all', 0, 1, 0, 0) in
/var/www/quadplex/drupal-6.20/modules/node/node.module
on line 2267.

Lock wait timeout exceeded; try
restarting transaction query:
content_write_record /* Guest :
content_write_record */ UPDATE
content_field_rating SET vid = 503621,
nid = 503621, field_rating_value =
1212 WHERE vid = 503621 in
/var/www/quadplex/drupal-6.20/sites/all/modules/cck/content.module
on line 1213.

The nids in these two queries are always the same and refer to two nodes that are frequently automatically updated by a custom module. I can track down a correlation between these errors and unusually many web requests in the Apache logs. I would understand that the website would become slower because of this. But:

  1. Why do these errors occur, and how can they be solved? It seems to me it's to do with several web requests trying to update the same node at the same time. But surely Drupal should deal with this by locking the tables etc? Or should I deal with it in some special way?

  2. Despite the higher web load, why does the database completely lock and require to be rebooted? Wouldn't it be better if the website still had access to Mysql and so, once the load is lower, it can serve pages again? Is there some setting for this?

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

极致的悲 2024-11-21 02:26:09

可以解决以下三件事中的一项或全部来检查:

  1. 您的磁盘空间不足吗?从 ssh 中,键入命令 df -h 并确保仍有磁盘空间。

  2. 桌子是否损坏?修复 phpMyAdmin 中的表,或 CLI 说明:http:// dev.mysql.com/doc/refman/5.1/en/repair-table.html

  3. 您是否使用 /etc/my.cnf 对 mysql 进行了性能调整?请参阅此了解更多想法:http://drupal.org/node/51263

Can be solved one or all of these three things to check:

  1. are you out of disk space? From ssh, type command df -h and make sure you still have disk space.

  2. Are the tables damaged? Repair the tables in phpMyAdmin, or CLI instructions here: http://dev.mysql.com/doc/refman/5.1/en/repair-table.html

  3. Have you performance-tuned your mysql with an /etc/my.cnf? See this for more ideas: http://drupal.org/node/51263

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文