• Resolved davecoledave

    (@davecoledave)


    Hello, I am using redis object cache and wp rocket on my wp website. I don’t use woocommerce. I have normal blog website. In day time site runs fine. If I publish 5-7 posts then server load goes high. while checking I can see that mysql sql is using 300-500%

    In evening time, without publishing a single post server load goes 500-800%. While checking mysql is using 500%+ cpu. If redis cache is working then why mysql is using high cpu? I am using below lines in wp-config:

    define( ‘WP_REDIS_HOST’, ‘127.0.0.1’ );
    define( ‘WP_REDIS_PORT’, 6379 );
    define( ‘WP_REDIS_PASSWORD’, ‘7a98765287’ );
    define( ‘WP_REDIS_TIMEOUT’, 1 );
    define( ‘WP_REDIS_READ_TIMEOUT’, 1 );
    //change the database for each site to avoid cache collisions
    define( ‘WP_REDIS_DATABASE’, 0 );
    // supported clients: phpredis, credis, predis and hhvm
    define( ‘WP_REDIS_CLIENT’, ‘predis’ );

    what wrong I have done? I am not getting. Can you please help? Or should I use memcached? In phpmyadmin advisor it is written to use memcached for query caching. I am confused. Please help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    You might simply have more traffic or a more demanding site, than server resources. Try upgrading your plan, or use an APM tool like New Relic to identify what exactly is causing the load in your PHP and SQL processes.

    Thread Starter davecoledave

    (@davecoledave)

    @tillkruess I have daily 100k traffic and using high range server from hetzner. AMD Ryzen 9 7950X3D.

    Everything was fine 2 months ago. suddenly server load starts going high. In my view redis cache is not working properly. My server RAM usage is very low. only 10-13%. [16681 / 128016(MB)] used only.

    Redis cache is not using RAM? If RAM usages goes to 30% then my server load will go down. Before 2 months my server RAM was 29% used and everything was normal. but now only 10-13% and cpu load goes high. I am using wp rocket too. I have asked them too about RAM but no proper answer from them.

    Plugin Author Till Krüss

    (@tillkruess)

    If things suddenly started spiking, maybe a plugin was updated and it’s causing additional load.

    It’s important you give Redis Server enough RAM to hold your entire cache dataset, otherwise the server will use CPU to keep up with the pressure and evict keys constantly.

    Thread Starter davecoledave

    (@davecoledave)

    how to give enough RAM? In redis config RAM is set to zero. Do I need to set RAM anywhere else?

    manos2000

    (@manos2000)

    At redis.conf (located usually at /etc/redis.conf or /etc/redis/redis.conf) put max-memory value at the end

    Thread Starter davecoledave

    (@davecoledave)

    @manos2000 It is already set to 0 means no limit.

    You most likely are suffering from either a resource attack, a bot or crawler is triggering resource usage or something is not using the object cache in the WordPress API and just using MySQL directly. It could also be a combination.

    Check your access log for suspicious traffic, or as Till suggested use an APM to figure out what is causing the spike.

    Plugin Author Till Krüss

    (@tillkruess)

    What @jordantrizz said ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.