• Resolved bjornha

    (@bjornha)


    After upgrading to Pods 2.9.18 I have seen an abnormal increase of memory usage on our redis server.
    I upgraded 4 plug ins and Pods and Wordfence were those that use redis.
    After looking into the databases on the redis server I found a lot of these:
    Pods\Whatsit\Storage\Collection\find_objects:……..
    This is new to me.
    Before the upgrade our redis DBs where in the area of 50MB on a constant basis. Since the upgrade the has been a constant growth up ~550 GB today (3,5 days)
    Is there any chance there might be an issue in this plug-in here?
    Kind Regards,
    Bj?rn Hasselberg
    PS, using WP Redis and have updated to latest version, but see no difference in growth

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter bjornha

    (@bjornha)

    Stats from our sites using the redis DB
    Site 1
    Keys?Pods\Whatsit\Storage\Collection/find_objects:*STRING
    Storage ~127 MB
    # of keys ~10 800 (set with no expiry?)
    Site 2
    Keys?Pods\Whatsit\Storage\Collection/find_objects:*STRING
    Storage ~51 MB
    # of keys ~4 300 (set with no expiry?)
    Site 3
    Keys?Pods\Whatsit\Storage\Collection/find_objects:*STRING
    Storage ~53 MB
    # of keys ~4 500 (set with no expiry?)
    Site 4
    Keys?Pods\Whatsit\Storage\Collection/find_objects:*STRING
    Storage ~156 MB
    # of keys ~13 100 (set with no expiry?)
    Site 5
    Keys?Pods\Whatsit\Storage\Collection/find_objects:*STRING
    Storage ~55MB
    # of keys ~4 700 (set with no expiry?)
    Site 6
    Keys?Pods\Whatsit\Storage\Collection/find_objects:*STRING
    Storage ~22 MB
    # of keys ~1 800 (set with no expiry?)

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I’ll look into this and see what might be going on, thanks for the heads up with your findings.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    @bjornha What version of Pods were you using previously? I’m trying to look over recent changes but not seeing anything in the recent versions that changed there.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I’m also not seeing any cases where we set transients or object cache values without expiration, we always have an expires set on those calls.

    Thread Starter bjornha

    (@bjornha)

    Looking at your changelog, most probably 2.9.13, we patch about once a month, if no critical upgrades comes along, and there was an upgrade on the 12th of May.
    But you do recognize the Pods\Whatsit\Storage\Collection path?

    • This reply was modified 1 year, 8 months ago by bjornha.
    Thread Starter bjornha

    (@bjornha)

    Probably gets applied from here:

    if ( $use_cache ) {
                pods_static_cache_set( $cache_key, $objects, self::class . ‘/find_objects’ );
            }

    Pods\Whatis\Storage\Collection.php
    Line 313-315

    There are more references to find_objects, but then always with a trailing slash “/find_objects/”, not “/find_objects”

    • This reply was modified 1 year, 8 months ago by bjornha.
    • This reply was modified 1 year, 8 months ago by bjornha.
    Thread Starter bjornha

    (@bjornha)

    It could also have something with the salt handling to do as the salt is being used as part of the cache key.
    Line 191 in Collection.php
    “$cache_key = wp_json_encode( $args ) . $object_collection->get_salt();”
    Anything that could have caused (major) increase in calls to refresh_salt() ?

    • This reply was modified 1 year, 8 months ago by bjornha.
    Thread Starter bjornha

    (@bjornha)

    2.9.13 as previous version confirmed.
    ‘105695’, ‘pods_framework_version_last’, ‘2.9.13’, ‘yes’

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    The static cache doesn’t use Redis, or I didn’t think it could.

    https://github.com/pods-framework/pods/blob/main/src/Pods/Static_Cache.php

    It literally just stores it for the moment for future calls and isn’t intended as a persistent cache.

    We’ll have to keep looking to see what the real cause is there but knowing your previous version gives me a better way to look at what might affect this.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I’m not seeing any changes since 2.9.13 that could cause this type of behavior: https://github.com/pods-framework/pods/compare/2.9.13…2.9.18#diff-0117e43d2074fed2d05fb9eaf36209821d49ea87071c4a78a5559c705e1c5b8d

    The salting is only for the local static cache itself and refreshes when new objects are registered via code/file. It’s not a persistent salt either.

    I’m not sure what’s going on here, I have looked through all of the changes since 2.9.13 and don’t see anything that would cause that yet.

    I’ve seen a report that sometimes Pods flushes cache too much, but that wouldn’t explain your growing cache ??

    Thread Starter bjornha

    (@bjornha)

    OK, can we agree on that the keys in redis looks like the one being generated from Collection.php?
    I can do a rollback to 2.9.13 on one site to see if the behaviour changes, but did the upgrade from .13 to .19 change the database in anyway?
    (stated as 2.3.5)

    Thread Starter bjornha

    (@bjornha)

    Also, I cant find the definition of the function “pods_static_cache_set” that Collection.php uses to set this value, where is that function in the source?

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    If you’d like to join our Live Community Pods Slack at https://support.pods.io/chat/ — I’m sure we can help you debug this more quickly and get to the bottom of the issue. Once you join, just look for me and send me a Direct Message and I can work with you to figure this out.

    Is that something you’re open to?

    Thread Starter bjornha

    (@bjornha)

    Fine, I need to fix some stuff, but will be in touch.

    Thread Starter bjornha

    (@bjornha)

    Solved through excellent support. Correction already in place in 2.9.19.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘2.9.18 – creating massive amounts of redis entries?’ is closed to new replies.