How to enable Redis Cache via Unix Socket on Moodle
Knowledgebase Article
}
Knowledgebase Article
First of all, you will need to enable your Redis instance via cPanel. You can follow the instructions here: Enable Redis Unix Socket
Once your Redis instance is setup, you will need to configure it via Moodle config.php file, you need the following lines:
$CFG->session_handler_class = '\core\session\redis';
$CFG->session_redis_host = '/home/USERNAME/.kxcache/redis.sock';
$CFG->session_redis_port = -1; // Optional if TCP. For socket use -1
$CFG->session_redis_database = 0; // Optional, default is db 0.
$CFG->session_redis_prefix = 'sess_'; // Optional, default is don't set one.
$CFG->session_redis_acquire_lock_timeout = 120;
$CFG->session_redis_lock_expire = 7200;
$CFG->session_redis_serializer_use_igbinary = true;
Please consider that we are using IGBinary, this PHP module will need to be enabled from your PHP Selector in cPanel. It's optional, you are free to choose either to use this serializer or the PHP default one. We recommend IGBinary, of course.
Finally, the last step is to configure Moodle cache with Redis by following their documentation instructions: https://docs.moodle.org/39/en/Redis_cache_store
If you have any question, don't hesistate to contact us!
Powered by WHMCompleteSolution