WordPress / performance

Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules.
https://wordpress.org/plugins/performance-lab/
GNU General Public License v2.0
356 stars 98 forks source link

Multisite triggers UPDATE queries on _sitemeta of almost 150k characters #1543

Closed yulumadavid closed 2 weeks ago

yulumadavid commented 3 weeks ago

Bug Description

I was checking mysql to see why the binlog was so huge. I temporarily wrote mysql queries to general.log and after that took an evening to run some checks.

I first checked what qeuries were the longest and then focused on the _sitemeta and checked again:

root@webshops04:/var/log/mysql# grep -oP "UPDATE.wp_ec9ff84fca_sitemeta.WHERE.*" /var/log/mysql/general.log | awk '{print length, substr($0, 1, 150) "...", substr($0, length($0)-100)}' | sort -nr | head -n 20 145439 UPDATE wp_ec9ff84fca_sitemeta SET meta_value = 'O:8:\"stdClass\":5:{s:12:\"last_checked\";i:1726602500;s:8:\"response\";a:23:{s:21:\"cardgate/card... updater.php\";s:5:\"0.2.1\";}}' WHERE site_id = 1 AND meta_key = '_site_transient_update_plugins' 144408 UPDATE wp_ec9ff84fca_sitemeta SET meta_value = 'O:8:\"stdClass\":5:{s:12:\"last_checked\";i:1726602574;s:8:\"response\";a:23:{s:21:\"cardgate/card... updater.php\";s:5:\"0.2.1\";}}' WHERE site_id = 1 AND meta_key = '_site_transient_update_plugins' 143388 UPDATE wp_ec9ff84fca_sitemeta SET meta_value = 'O:8:\"stdClass\":5:{s:12:\"last_checked\";i:1726602547;s:8:\"response\";a:23:{s:21:\"cardgate/card... updater.php\";s:5:\"0.2.1\";}}' WHERE site_id = 1 AND meta_key = '_site_transient_update_plugins' 141499 UPDATE wp_ec9ff84fca_sitemeta SET meta_value = 'O:8:\"stdClass\":5:{s:12:\"last_checked\";i:1726602524;s:8:\"response\";a:22:{s:21:\"cardgate/card... updater.php\";s:5:\"0.2.1\";}}' WHERE site_id = 1 AND meta_key = '_site_transient_update_plugins' 139144 UPDATE wp_ec9ff84fca_sitemeta SET meta_value = 'O:8:\"stdClass\":5:{s:12:\"last_checked\";i:1726602522;s:8:\"response\";a:23:{s:21:\"cardgate/card... -add-on.php\";s:5:\"1.1.8\";}}' WHERE site_id = 1 AND meta_key = '_site_transient_update_plugins' 137255 UPDATE wp_ec9ff84fca_sitemeta SET meta_value = 'O:8:\"stdClass\":5:{s:12:\"last_checked\";i:1726602502;s:8:\"response\";a:22:{s:21:\"cardgate/card... -add-on.php\";s:5:\"1.1.8\";}}' WHERE site_id = 1 AND meta_key = '_site_transient_update_plugins'

In wp_config i switched the CRON off and manually added a cron for each subsite (i run a site per domain, 3 in total)

So now i'm wondering, why would WP Multisite update this cron meta value time over time with a query of almost 150k characters? Why can't the system check only once a night for updates?

I've searched on this meta_key online but no results so I wonder if this isn't an issue or am i the only one facing this issue?

swissspidy commented 3 weeks ago

This sounds like a bug report for core, so https://core.trac.wordpress.org/ would be more suitable

yulumadavid commented 2 weeks ago

@swissspidy thanx for pointing out https://core.trac.wordpress.org/ticket/62104#ticket