Shared Instances

When running more than one WordPress installation on the same Redis instance or cluster, you must either use a separate database for each site, or prefix alternatively specify a prefix for each site. Without that, you site will likely crash.

Using Databases

For the best performance, it's recommended to use a different database index 0-15 for each WordPress installation, by using the database configuration option. By default, Redis has 16 databases, but this can be increased to in your redis.conf.

wp-config.php
define('WP_REDIS_CONFIG', [
'host' => '127.0.0.1',
'database' => 0,
]);

This approach does not work on a cluster, since clusters only have a single database.

Using Prefixes

When only a single database is available to you, best way to isolate individual sites is using the prefix configuration option.

wp-config.php
define('WP_REDIS_CONFIG', [
'prefix' => 'mysitename',
]);

Prefixes must be 14 characters or less. To optimize human readability avoid special characters and use simple string such as:

// Good
'apple'
'bugs-apple'
'apple-jobs'
// Bad
'apple_com'
'jobs.apple.com'
'1f3870be274f6c49b3e31a0c6728957f'