Bug #22643
closedjetpack "heartbeat" space-used calculation not compatible with S3
0%
Description
Peeping Tom Jetpack collects a bunch of information about our installation and sends it back to the mothership. This includes calls to get_space_used()
: https://github.com/cuny-academic-commons/cac/blob/e9e68ce56e54e32bc231240e236011b1550d2d15/wp-content/plugins/jetpack/class.jetpack-heartbeat.php#L87 Following the call stack, WP then tries to do file operations on s3://
assets. Our S3 stream wrapper means that these mostly work, but they take forever, and sites with a lot of media can end up triggering massive overhead as we perform operations on remote files.
In a perfect world, we'd nuke Jetpack entirely, or at least disable these "heartbeat" phone-homes. This is probably not possible at the moment, as it will have other side effects.
get_space_used()
is only used in a small handful of places, and it's likely to encounter similar problems no matter where it's called. For the moment, I'm going to use the 'pre_get_space_used'
filter to short-circuit this calculation.
Updated by Boone Gorges about 1 month ago
- Category name changed from WordPress Plugins to S3 Uploads
- Status changed from New to Resolved
Implemented in https://github.com/cuny-academic-commons/cac/commit/820f2ded78ce88779e7193455e0f331060af9fb3 and deployed to production.
Updated by Raymond Hoh about 1 month ago
In a perfect world, we'd nuke Jetpack entirely, or at least disable these "heartbeat" phone-homes.
We should consider wiping out all of Jetpack's Heartbeat stats with their 'jetpack_heartbeat_stats_array'
filter: https://github.com/Automattic/jetpack/blob/bf8432d31a1e0633d8ca0a97c4d5fee83d8a1836/projects/packages/connection/src/class-heartbeat.php#L165.
Updated by Boone Gorges about 1 month ago
Yeah, but will this break some wordpress.com interaction? If wordpress.com sees a lot of bad or nonexistent data coming from a site, will it sever the connection or do some other dumb thing? This is not meant as a rhetorical question - maybe you or Jeremy know :-D