Drupal website blocked due to many connection errors - website disabled

From time to time, the number of connections to the database from our Drupal 6.20 system to our Mysql database reaches 100-150, and after a while the site goes offline. The error message when trying to connect to Mysql manually is blocked due to many connection errors. Unlock mysqladmin flush-hosts. Since the database is hosted on Amazon RDS, I do not have permission to this command, but I can restart the database after reloading the website is working fine again. Until next time.

Drupal reports several errors prior to the release of two types of offline mode:

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

Timed out waiting for lock wait; try restarting the transaction request: 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, which are often automatically updated by the custom module. I can track the correlation between these errors and unusually many web requests in Apache logs. I would understand that because of this, the site will become slower. But:

  • Why do these errors occur and how can they be resolved? It seems to me that this applies to several web requests trying to update the same node at the same time. But, of course, should Drupal handle this by locking tables, etc.? Or should I do this in some special way?

  • Despite a higher load on the Internet, why is the database completely locked and requires a reboot? Wouldn't it be better if the site still had access to Mysql, and therefore, as soon as the download is lower, it will be able to serve the pages again? Are there any settings for this?

Thanks!

+4
source share
1 answer

You can solve one or all of these three things to check:

+2
source

All Articles