Project

General

Profile

Actions

Bug #22643

closed

jetpack "heartbeat" space-used calculation not compatible with S3

Added by Boone Gorges about 1 month ago. Updated about 1 month ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
S3 Uploads
Target version:
Start date:
2025-04-24
Due date:
% Done:

0%

Estimated time:
Deployment actions:

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.
Actions

Also available in: Atom PDF