WIP / UNVERIFIED: This draft is based on CloudLinux documentation and has not been tested on a server. The persistence and new-account behavior is not documented. Source ticket: #96115675.
Question
How do I change maxmemory-policy (for example to allkeys-lru) for the per-account Redis object cache created by CloudLinux AccelerateWP? The cache currently uses noeviction, and WordPress logs "OOM command not allowed" once an account reaches its maxmemory limit (64 MB).
Answer
CloudLinux manages this cache, not cPanel. CloudLinux's documentation does not describe a supported setting for the eviction policy. None of the cloudlinux-awp-admin, cloudlinux-awp-user, or clwpos options documented on the CloudLinux OS Pro Components page cover memory or eviction. The 64 MB limit appears only as max_cache_memory in cloudlinux-awp-user output.
Each user's instance has its own config file in ~/.clwpos/:
- AccelerateWP before 1.11-1:
redis.conf, socketredis.sock, binary/opt/alt/redis/bin/redis-server - AccelerateWP 1.11-1 and later (Valkey):
valkey.conf, socketvalkey.sock(withredis.sockkept as a link), binary/opt/alt/valkey/bin/valkey-server
The clwpos_monitoring daemon starts and restarts these instances every 5 minutes. It is not documented whether a manual config change survives a restart, an AccelerateWP update (including the Redis to Valkey migration), or applies to newly created accounts.
Test on a single account (not documented as supported)
-
As root, check the current value (use the Valkey binary and
valkey.sockon 1.11-1 and later):/opt/alt/redis/bin/redis-cli -s /home/USER/.clwpos/redis.sock CONFIG GET maxmemory-policy -
Set the policy on the running instance. This takes effect immediately and does not clear the cache:
/opt/alt/redis/bin/redis-cli -s /home/USER/.clwpos/redis.sock CONFIG SET maxmemory-policy allkeys-lru -
Optionally write it to the instance's config file (this assumes the instance was started with a config file):
/opt/alt/redis/bin/redis-cli -s /home/USER/.clwpos/redis.sock CONFIG REWRITE - To test persistence, stop the user's
redis-serverorvalkey-serverprocess, wait for the monitoring daemon to restart it (up to 5 minutes), and runCONFIG GET maxmemory-policyagain.
Troubleshooting
- Check which binary an instance uses:
ps aux | grep -E 'valkey-server|redis-server' - Check the monitoring daemon:
service clwpos_monitoring status - Logs:
/var/log/clwpos/main.log,/var/log/clwpos/daemon.log,/home/USER/.clwpos/main.log - If the setting does not persist, open a case with CloudLinux and ask for a supported eviction-policy setting for AccelerateWP's per-user cache.
Comments
0 comments
Please sign in to leave a comment.