Support » Plugin: Redis Object Cache » Redis cache with multiple wordpress sites

  • Resolved ironhead3

    (@ironhead3)


    Hello, I have 5+ wordpress websites on single VM I have installed redis and added the plug-in to only one site as of now. If I want to have redis for all the sites what do I need to do? Do I need to modify wp-config.php or should I simply install the plug-in and connect to redis on all the remaining sites?

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

    (@tillkruess)

    You can use the same Redis Server for all 5 sites, just use a different database for each site define( 'WP_REDIS_DATABASE', 0);, use 0-16.

    Thread Starter ironhead3

    (@ironhead3)

    Thanks for the information

    Thread Starter ironhead3

    (@ironhead3)

    I have added the config but the plugin page is showing database 0. However I can see the changes made to MAXTTL in the same wp-config.php. What should I do now?

    When I run redis-cli INFO keyspace I see only db0 but not the other database (db1 which I added the config in site2)
    After adding define( 'WP_REDIS_DATABASE', 1); I cleared the cache using flushall and restarted redis and php. But still the plugin page is showing the database as 0. Sometimes it redirects to the site1 which has redis db0.

    • This reply was modified 1 month, 1 week ago by ironhead3.
    Plugin Author Till Krüss

    (@tillkruess)

    Try flushing your PHP Opcode cache?

    Thread Starter ironhead3

    (@ironhead3)

    I tried clearing the Opcode cache but no luck. Here’s the configuration for second site (site2) on the same server:

    I have added define( 'WP_REDIS_DATABASE', 1 ); to this site since site1 has Database 0. But the plugin in site2 is connecting to the Database 0 (https://i.imgur.com/73yfyxn.jpeg). However if I go to metrics tab I see a different value (https://i.imgur.com/H8Motih.jpeg). Upon opening the object-cache.php located at /var/www/site2.com/wp-content/object-cache.php I see Database 0 (https://i.imgur.com/5Lkg2eX.jpeg)

    The object-cache.php of both site1 and site2 is having the same entry. Is this a bug or a configuration mistake from my side?

    Plugin Author Till Krüss

    (@tillkruess)

    Are you declaring WP_REDIS_DATABASE too far down in your wp-config.php?

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