• Resolved Rolf Allard van Hagen

    (@ravanh)


    Hi, I’m running into a weird issue I have not seen before:

    When Stats are enabled, the database options table will fill up with transients of type _transient_jetpack_restapi_stats_cache_XXXX, bloating the table size from around 6.5 Mb to over 100 Mb in just a few hours.

    I discovered this because the hosting provider sent a warning message about the database being locked for further writes. Turned out the options table had grown over the past few days to over 2 Gig, breaching the provider’s limit.

    All expired transients :/

    This is a live site where I cannot simply turn off all other plugins and switch the theme. The only way to avoid the database from growing like mad and get locked down again, is to switch Jetpack Stats off.

    Is there any known or obvious reason why these expired transients would not get pruned over time?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Rolf Allard van Hagen

    (@ravanh)

    Same seems to go for the Brute force protection module. Thousands and thousands of expired transients style _transient_jpp_li_XXXX in the options table. Each of them being relatively small in size, they do not bloat the database size as fast as the stats transients, but still…

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hi there, @ravanh,

    Thanks for reporting this.

    I checked internally, and this is a known behaviour related to how WordPress handles transient garbage collection. It’s “lazy,” meaning expired transients are only deleted when accessed again, not proactively. If they expire without being re-queried, they accumulate indefinitely.

    While I will create a bug report for our tech team (I trust I can mention your site URL and host), there are some solutions you want to try in the meantime:

    1. Immediate cleanup via WP-CLI: wp transient delete --expired Or manually via phpMyAdmin targeting expired transients.
    2. Long-term: implement a persistent object cache if your host supports it; transients will auto-expire properly there instead of bloating the database.
    3. Scheduled maintenance: a plugin like Transient Manager can handle regular clean up if object caching isn’t an option.

    Let us know if the above may work out for you.

    (Internal reference: JETPACK-1268)

    Thread Starter Rolf Allard van Hagen

    (@ravanh)

    Hi, thanks for the response. Yes, I’m aware of how WordPress handles transients. But allowing the database to grow well over 1 Gig per day… And just for stats? That’s crazy.

    Thanks for the tip on object caching, and for relaying the issue πŸ™‚

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hi there, @ravanh,

    Yeah, I agree that 1GB per day is a bit too much. I’d rely on our tech team to shed some lights on this and possibly find a better way to handle it.

    Let us know if the workarounds work while we investigate the issue, and thanks for bearing with us πŸ™‚

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hey @ravanh!

    Just a quick follow-up to let you know that we don’t have meaningful updates on the issue I reported.

    We’ll circle back here again once we know more worth sharing:)

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hey @ravanh,

    Just a quick update about our engineers having investigated the issue and confirmed it’s something we need to fix. They’re working to find a solution that can works for good. Thanks for bearing with us; we’ll share more updates as they come πŸ™‚

    Plugin Support lastsplash (a11n)

    (@lastsplash)

    Hi @ravanh

    Our team is working on code changes here that will ship in an upcoming release. I’d suggest updating Jetpack with the next release and keeping an eye on the changelog to see when the fix is included:

    https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/jetpack/CHANGELOG.md

    [Internal reference: STATS-216]

    Thread Starter Rolf Allard van Hagen

    (@ravanh)

    Excellent stuff. Thanks !

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.