Hi Alan,
Did you get this to work? We just upgraded to 3.5.1 and I've not seen a slow admin interface. We are using NGINX, but as a reverse proxy to the standard Apache/PHP setup. Our Redis server and moodledata are on the same VPS,
Here are some things to try:
- Site administration -> Plugins -> Cache stores -> Redis
- Enter the test server information, such as your Redis server in the Test server field. (mine is 127.0.0.1:6379)
- Site administration -> Plugins -> Caching -> Configuration
- Honestly, I don't know if you need this...
- Add a store instance to Redis
- It should be ready (with a green check) and have at least one store
- You can view the store instance information under Configured store instances
- Site administration -> Plugins -> Caching -> Test performance
- Run a test set
- If Redis is working, you should see the information there.
- Run the largest test set. Perhaps you can't do this on your setup, but you might be able to monitor the processor status through htop on your caching instance. If so, you should see redis show up in the process list as it processes the large request set.
- Here are my values (for comparison)
- 500 requests: 0.0202 0.0162 0.0172 0.0142
- 10000 requests: 0.3055 0.3017 0.2946 0.3084
- 100000 requests: 3.2092 2.9187 3.0452 3.1045
- Verify Redis is properly handling the requests using redis-cli monitor
- https://redis.io/commands/monitor
- This is from our VPS:
1531191276.803634 [0 127.0.0.1:38460] "PING"
1531191276.803894 [0 127.0.0.1:38460] "SETNX" "bm_moodlean1nng1eq5a49kqhctil830gn4.lock" "s:1:\"1\";"
1531191276.804052 [0 127.0.0.1:38460] "EXPIRE" "bm_moodlean1nng1eq5a49kqhctil830gn4.lock" "7200"
1531191276.804179 [0 127.0.0.1:38460] "GET" "bm_moodlean1nng1eq5a49kqhctil830gn4"
1531191276.804351 [0 127.0.0.1:38460] "EXPIRE" "bm_moodlean1nng1eq5a49kqhctil830gn4" "7280"
1531191276.810255 [0 127.0.0.1:38460] "SETEX" "bm_moodlean1nng1eq5a49kqhctil830gn4" "7280" "s:228:\"USER|O:8:\"stdClass\":2:{s:2:\"id\";i:0;s:10:\"mnethostid\";s:1:\"1\";}SESSION|O:8:\"stdClass\":3:{s:4:\"lang\";s:2:\"en\";s:8:\"wantsurl\";s:29:\"https://moodle.my-instance.com/\";s:7:\"fromurl\";s:44:\"https://moodle.my-instance.com/cache/admin.php\";}\";"
1531191276.810391 [0 127.0.0.1:38460] "DEL" "bm_moodlean1nng1eq5a49kqhctil830gn4.lock"
When I logged in, it set (and cached) a very code containing all of the admin user information:
"s:3485:\"USER|O:8:\"stdClass\":60:{s:2:\"id\";s:1:\"2\";s:4:\"auth\";s:6:\"manual\";s:9:\"confirmed\";s:1:\"1\";s:12:\"policyagreed\";s:1:\"0\";s:7:\"deleted\";s:1:\"0\";s:9:\"suspended\";s:1:\"0\";s:10:\"mnethostid\";s:1:\"1\";s:8:\"username\";s:11:\"bm_admin\";s:8:\"idnumber\";s:0:\"\";s:9:\"firstname\";s:11:\"bm_admin\";s:8:\"lastname\";s:5:\"Admin\";s:5:\"email\";s:21:\"admin@my-instance.com\";s:9:\"emailstop\";s:1:\"0\";s:3:\"icq\";s:0:\"\";s:5:\"skype\";s:0:\"\";s:5:\"yahoo\";s:0:\"\";s:3:\"aim\";s:0:\"\";s:3:\"msn\";s:0:
.
.
.
:16:\"contexthasrepos5\";a:3:{i:0;i:1531191348;i:1;s:1:\"2\";i:2;s:4:\"b:0;\";}}}s:21:\"load_navigation_admin\";i:1;}\";"
1531191351.701704 [0 127.0.0.1:38526] "DEL" "bm_moodledvd4lh4j0cq98qi6g18aaikmv5.lock"
Finally, here are the settings in the config.php file (mostly default):
// Redis session handler (requires redis server and redis extension):
$CFG->session_handler_class = '\core\session\redis';
$CFG->session_redis_host = '127.0.0.1';
$CFG->session_redis_port = 6379; // Optional.
$CFG->session_redis_database = 0; // Optional, default is db 0.
$CFG->session_redis_auth = ''; // Optional, default is don't set one.
$CFG->session_redis_prefix = 'bm_moodle'; // Optional, default is don't set one.
$CFG->session_redis_acquire_lock_timeout = 120;
$CFG->session_redis_lock_expire = 7200;
I hope this helps!