Quantcast
Channel: Active questions tagged users - Drupal Answers
Viewing all articles
Browse latest Browse all 472

MySQL log files filling disk

$
0
0

I do not know much about Drupal. I have a Drupal 10 installation using MySQL 8.0.37 on Ubuntu 22.04. The Drupal site is the only thing running on this server.

MySQL is filling the /var/lib/mysql/ directory with binary log files of the form binlog.000572 at a rate of something like 50MB/hour. Within a few days to a week, this fills the hard drive and threatens a system crash.

This question is more or less identical to this one. The comments to that question indicate that the issue is Drupal 10's "state cache". Unfortunately, the only suggested solution is to disable the state cache. This is not a proper solution, since Drupal 10 seems to be designed by intention to use the state cache, and in fact Drupal 11 will make it mandatory and not disableable. I'm in search of a proper solution to prevent Drupal from generating 50MB/hour of MySQL log files.

The linked drupal.org page for the Drupal 10 state cache gives a couple of tips for figuring out what's generating state cache-based log content. Running these on my database for the Drupal 10 site gives

mysql> SELECT COUNT(*), SUM(LENGTH(value)) FROM key_value WHERE collection = 'state';+----------+--------------------+| COUNT(*) | SUM(LENGTH(value)) |+----------+--------------------+|       25 |              11345 |+----------+--------------------+1 row in set (0.00 sec)mysql> SELECT name, LENGTH(value) FROM key_value WHERE collection = 'state' ORDER BY LENGTH(value) DESC LIMIT 100;+---------------------------------------+---------------+| name                                  | LENGTH(value) |+---------------------------------------+---------------+| routing.non_admin_routes              |          5695 || system.profile.files                  |          1650 || views.view_route_names                |          1434 || router.path_roots                     |          1006 || routing.menu_masks.router             |           556 || system.theme.files                    |           488 || twig_extension_hash_prefix            |           130 || system.cron_key                       |            82 || system.private_key                    |            82 || node.min_max_update_time              |            80 || install_time                          |            13 || update.last_check                     |            13 || simple_sitemap.last_cron_generate     |            13 || system.cron_last                      |            13 || system.css_js_query_string            |            13 || update.last_email_notification        |            13 || webform.version                       |            12 || install_task                          |            11 || comment.node_comment_statistics_scale |             9 || migrate_tools_sync                    |             6 || field.storage.deleted                 |             6 || field.field.deleted                   |             6 || webform.element.message               |             6 || system.maintenance_mode               |             4 || comment.maintain_entity_statistics    |             4 |+---------------------------------------+---------------+

Since I'm not a Drupal programmer, these mean nothing to me, but I hope someone here can deduce something from them. Based on these, what should be my next troubleshooting step?

Aside from the linked drupal.SE question, everything else I can find on this error comes up for Drupal 6. Was there anything that happened in Drupal 6 that might have regressed or recurred for Drupal 10?

Edit: The log files are so large that they're difficult for me to scan through without something to grep for. Here's a sample from near the beginning of one log; there are many rows like this:

#240723  4:28:07 server id 1  end_log_pos 5587775 CRC32 0x0413cc3c      Delete_rows: table id 116# at 5587775#240723  4:28:07 server id 1  end_log_pos 5593669 CRC32 0x03e6424d      Delete_rows: table id 116# at 5593669#240723  4:28:07 server id 1  end_log_pos 5601413 CRC32 0x717fba95      Delete_rows: table id 116# at 5601413#240723  4:28:07 server id 1  end_log_pos 5614484 CRC32 0x68663b12      Delete_rows: table id 116# at 5614484#240723  4:28:07 server id 1  end_log_pos 5621579 CRC32 0xb1a2fa47      Delete_rows: table id 116# at 5621579#240723  4:28:07 server id 1  end_log_pos 5629561 CRC32 0x3d26e53f      Delete_rows: table id 116# at 5629561#240723  4:28:07 server id 1  end_log_pos 5636692 CRC32 0x322da116      Delete_rows: table id 116# at 5636692

Here's a sample from a little later:

BINLOG 'l2mfZhMBAAAAVwAAAJYBAAAAAHQAAAAAAAEAC3F1YXJrbmV0ZDEwAAxjYWNoZV9yZW5kZXIABw/8CPYC/A8I/wAEDgME/wAiAQEAAwZBP/z/AAuSWl5Al2mfZiABAAAAZBcAAPoYAAAAAHQAAAAAAAAAAgAH/wDjZW50aXR5X3ZpZXc6YmxvY2s6cXVhcmtfcHJpbWFyeV9sb2NhbF90YXNrczpbbGFuZ3VhZ2VzOmxhbmd1YWdlX2ludGVyZmFjZV09ZW46W3JvdXRlXT1lbnRpdHkudGF4b25vbXlfdGVybS5jYW5vbmljYWw1NTM0ZTdlNzEzYmMxMmY2YWYwYmRmZWZhZGI4N2I5MGY4NTZmZWI3ZTk0ZjUxM2Y4NTdjM2RiOWJmZmMyNDFiOlt0aGVtZV09cXVhcms6W3VybC5xdWVyeV9hcmdzXT1wYWdlPTI6W3VzZXJdPTCRAQAAYTozOntzOjc6IiNtYXJrdXAiO3M6MDoiIjtzOjk6IiNhdHRhY2hlZCI7YTowOnt9czo2OiIjY2FjaGUiO2E6Mzp7czo4OiJjb250ZXh0cyI7YTo3OntpOjA7czoyODoibGFuZ3VhZ2VzOmxhbmd1YWdlX2ludGVyZmFjZSI7aToxO3M6NToidGhlbWUiO2k6MjtzOjE2OiJ1c2VyLnBlcm1pc3Npb25zIjtpOjM7czo1OiJyb3V0ZSI7aTo4O3M6

This huge block of random letters is so large that when I try to scroll through it in nano, I can't scroll past the end of it before getting tired and giving up.

Do these mean anything useful?


Viewing all articles
Browse latest Browse all 472

Trending Articles