• Resolved jamiejames

    (@jggretton)


    Hi Till, firstly – thanks so much for all your work on this plugin, really appreciated.

    I’ve just set up Redis Cache on the test server for a site that hosts online events. We get very little traffic 99% of the time, and then a surge of visitors before an event. This has been causing issues!

    We’ve got buddyboss installed so that users can communicate, but this means that page caching isn’t really an option. Hoping that object cache will be our saviour!

    So far though, I haven’t seen much difference in speed, but I have noticed that my timing metrics graph looks rubbish compared to other people’s screenshots: https://ibb.co/v3Lr5Mj I wondering if this is a sign that something’s not setup right?

    Diagnostics data below. Any first thoughts / steer towards anything I should try?

    Thanks so much

    Status: Connected
    Client: PhpRedis (v5.3.2)
    Drop-in: Valid
    Disabled: No
    Ping: 1
    Errors: []
    PhpRedis: 5.3.2
    Relay: Not loaded
    Predis: Not loaded
    Credis: Not loaded
    PHP Version: 7.4.29
    Plugin Version: 2.0.25
    Redis Version: 3.2.12
    Multisite: No
    Metrics: Enabled
    Metrics recorded: 368
    Filesystem: Working
    Global Prefix: "wp_"
    Blog Prefix: "wp_"
    Global Groups: [
        "blog-details",
        "blog-id-cache",
        "blog-lookup",
        "global-posts",
        "networks",
        "rss",
        "sites",
        "site-details",
        "site-lookup",
        "site-options",
        "site-transient",
        "users",
        "useremail",
        "userlogins",
        "usermeta",
        "user_meta",
        "userslugs",
        "redis-cache",
        "blog_meta",
        "bp",
        "bp_last_activity",
        "bp_member_type",
        "bp_xprofile",
        "bp_xprofile_data",
        "bp_xprofile_fields",
        "bp_xprofile_groups",
        "xprofile_meta",
        "bp_media",
        "bp_media_albums",
        "bp_document",
        "bp_document_folder",
        "document_meta",
        "document_folder_meta",
        "bp_notifications",
        "notification_meta",
        "bp_groups",
        "bp_group_admins",
        "bp_group_invite_count",
        "group_meta",
        "bp_groups_memberships",
        "bp_groups_memberships_for_user",
        "bp_activity",
        "bp_activity_comments",
        "activity_meta",
        "bp_activity_follow",
        "bp_messages",
        "bp_messages_threads",
        "bp_messages_unread_count",
        "message_meta"
    ]
    Ignored Groups: [
        "counts",
        "plugins",
        "themes",
        "wordfence",
        "wordfence-ls",
        "tribe-events-non-persistent"
    ]
    Unflushable Groups: []
    Drop-ins: [
        "Redis Object Cache Drop-In v2.0.25 by Till Krüss"
    ]
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    Does Redis Server sit on the same machine as WordPress?

    Thread Starter jamiejames

    (@jggretton)

    It should be on the same server, but based on your reply, it’s clearly slower than expected so I’ve sent a message to my hosts to ask for details. Will let you know the outcome.

    Thanks

    Plugin Author Till Krüss

    (@tillkruess)

    It looks like it’s on 127.0.0.1. What’s the hosting company?

    Thread Starter jamiejames

    (@jggretton)

    Hey, sorry for the delay – was hoping to get it all sorted with the hosting company first rather than having to bother you but sorry – here I am!

    My hosts are a small but nice and responsive company here in the UK – you wont have heard of them.

    You were spot-on before, I was connecting to a Redis server that had been setup for me on a different server (within the same hosts). I don’t think that was supposed to be possible though, so they’ve stopped that from working now ??

    They’ve now added Redis on this server (my dev server) but I’m unable to connect using the details they think should work, and they’re not sure why. Details they’ve recommended are:

    define( 'WP_REDIS_SCHEME', 'unix');
    define( 'WP_REDIS_PATH ', "/home/<myusername>/redis/redis.sock");
    define( 'WP_REDIS_DATABASE', 0 );

    (I have updated <myusername>!)

    Message I get in diagnostics:

    Connection Exception: php_network_getaddresses: getaddrinfo failed: Name or service not known (RedisException)
    Errors: [
        "php_network_getaddresses: getaddrinfo failed: Name or service not known"
    ]

    Do you have any advice for what I should try / ask the hosts?

    Many thanks

    Plugin Author Till Krüss

    (@tillkruess)

    Does the file /home/<myusername>/redis/redis.sock exist on your server’s filesystem?

    Thread Starter jamiejames

    (@jggretton)

    Yeah, my hosts say it’s there and they can connect to it. I haven’t delved deep enough to know the details so can’t confirm that myself, but can either pass direct questions to them, or can get my hands dirty and SSH in if required! Not sure what I’d be looking at yet though.

    Plugin Author Till Krüss

    (@tillkruess)

    What does this print?

    
    <?php
    
    $redis = new Redis();
    
    try {
        if ($redis->connect("/home/<myusername>/redis/redis.sock")) {
            echo "Connected!";
        }
    
    } catch (Exception $e) {
        echo $e->getMessage();
    }
    
    Thread Starter jamiejames

    (@jggretton)

    Connected!

    Plugin Author Till Krüss

    (@tillkruess)

    Can you post your wp-config.php with all secrets redacted?

    Thread Starter jamiejames

    (@jggretton)

    
    ... (comments) ...
    
    define( 'WP_MEMORY_LIMIT', '512M' );
    define( 'WP_MAX_MEMORY_LIMIT', '512M' );
    
    ... (db settings) ...
    
    // Get details for the current environment.
    $environment = <redacted>
    
    define('WP_HOME', $environment['wp_home']);
    define('WP_SITEURL', $environment['wp_site_url']);
    
    define('DB_NAME', $environment['db_name']);
    define('DB_USER', $environment['db_user']);
    define('DB_PASSWORD', $environment['db_password']);
    define('DB_HOST', $environment['db_host']);
    
    /**
     * Authentication Unique Keys and Salts.
    ....
    */
    
    define('WP_REDIS_SCHEME', 'unix');
    define( 'WP_REDIS_PATH ', "/home/<redacted>/redis/redis.sock");
    define( 'WP_REDIS_DATABASE', 0 );
    define( 'WP_REDIS_PORT', 0 );
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each
     * a unique prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix = 'wp_';
    
    define('WP_DEBUG', false);
    
    /* That's all, stop editing! Happy blogging. */
    
    /** Absolute path to the WordPress directory. */
    if ( ! defined( 'ABSPATH' ) )
    	define( 'ABSPATH', dirname( __FILE__ ) . '/' );
    
    /** Sets up WordPress vars and included files. */
    require_once ABSPATH . 'wp-settings.php';
    
    Thread Starter jamiejames

    (@jggretton)

    Hey, here’s something that might help:

    Line 700 of wp-content/object-cache.php. I’ve added a print_r($args):

    Array
    (
        [host] => 127.0.0.1
        [port] => 6379
        [timeout] => 1
        [0] => 
        [retry_interval] => 0
        [read_timeout] => 1
    )

    So it hasn’t got the .sock details

    Thread Starter jamiejames

    (@jggretton)

    Oh no! There was a space in my config ??

    define( 'WP_REDIS_PATH ' );

    I think we’re working! Will report back when I’ve tested.

    Plugin Author Till Krüss

    (@tillkruess)

    You have a space in your WP_REDIS_PATH definition.

    If that doesn’t fix it, try:

    
    define('WP_REDIS_HOST', "/home/<redacted>/redis/redis.sock");
    define('WP_REDIS_PORT', -1);
    define('WP_REDIS_DATABASE', 0);
    
    Thread Starter jamiejames

    (@jggretton)

    I wish I could rub out the last 10 messages! (thanks).

    So we are up and running again. My hosts have told me that Redis is on the same server – that path implies that it’s in my user account. But my metrics are still 60ms during low server load, and doubling when I give the server some traffic.

    https://ibb.co/ynwJh0Y

    Does this look like my Redis installation is rubbish?

    Plugin Author Till Krüss

    (@tillkruess)

    That’s 60ms total in Redis wait times. Not bad ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘What speeds I should expect’ is closed to new replies.