Hello,
I am running Moodle version 3.10 (Build: 20201109) as a cluster within AWS, on Centos 7 with PHP 7.4 and OpenResty 1.19.3.
Everything is running very smoothly and stable, however I am having some issues with configuring AWS Elasticache Redis to handle Application and Session cache. Although stable, I do have some slow page loads which I believe enabling the Redis cache store for application cache will help to improve. I have done other performance tweaks such as: only enabling Moodle modules I need, configured xsendfile (X-Accel-Redirect), amongst a few other things which have all had notable performance and stability improvements.
I have read various pages within Moodle Docs around caching, MUC etc including this one: https://docs.moodle.org/310/en/Caching
I have also followed the instructions on this page (https://docs.moodle.org/310/en/Redis_cache_store) for setting up the Redis cache store including the step for setting up the mappings - "Stores used when no mapping is present".
When it comes to confugring within Moodle (within Site Administration > Plugins > Cache > Configuration) the store instance is not ready to be used but has mappings are in place. The error I get is: "This store instance is not ready to be used but has mappings. Fixing this issue will improve performance on your system. Please check that the store backend is ready to be used and that any PHP requirements are met."
My connection settings (I have masked sensitive information with x and y)...
My mapping settings...
Mapping settings applied with an indication of a problem...
Description of the problem...
When I go into Site Administration > Plugins > Cache > Test Performance, it states that the "Store not ready" for Redis.
I can confirm I do have the PHP Redis module set up, and I am able to connect to the Elasticache Redis instance via a telnet connection from the EC2 instance, so there is nothing blocking the network traffic. As a test, I did set up the PHP session save handler to be Redis, and PHP was able to successfully use the instance as a session store. When viewing the monitoring section of AWS, it is possible to see the Redis store and the cache itself being hit. My web sessions are also terminated if I log in while Redis is handling sessions, and then I switch to the default "files" as a session handler. All of which further validates that connectivity is certainly ok.
I have tried numerous things to resolve this, all with no success:
- remove everything and started again in case I missed any steps or did anything incorrect (the oldest trick in the book!)
- stopped PHP from using Redis as a session handler in case it conflicted with Moodle
- ensured any $CGF->session_redis_* values are not being set in case it was conflicting with what the Moodle UI was setting
- destroyed and rebuilt my Elasticache Redis instance
I have seen a similar problem described elsewhere with people using Memcached, but this was for a local setup, not a remote store (i.e. AWS Elasticache), and the steps used to resolve elsewhere seemed irrelevant with Redis (mostly was a port issue elsewhere, I don't think that's the issue with Redis as I only have one port to use - 6379). I really cannot find any evidence elsewhere of someone else having the same issue with Redis or even Elasticache Redis.
Has anyone else seen this issue before? And does anyone have any ideas of what to do next?
Thanks,
Lee