Redis on CloudSonic

Cut database load by up to 80 percent by storing query results in memory with an object cache that never runs out

TL;DR Redis

Redis is installed and managed on every CloudSonic server, configured as a high performance object cache with LRU eviction and Unix socket connection for maximum speed.

Redis is an open source in-memory data structure store used as a cache, message broker, and session store, and it is installed and managed on every CloudSonic server. For WordPress sites it stores database query results in memory so repeat page loads never hit MySQL or MariaDB for data that has not changed, typically reducing database load by 50 to 80 percent on busy sites. Redis on CloudSonic is connected to PHP via a Unix socket for the lowest possible latency and configured with LRU eviction so it never runs out of memory.

Redis for Object Caching on CloudSonic

Redis on CloudSonic is connected to PHP via a Unix socket rather than a TCP port, eliminating network overhead for every cache read and write. It is configured with allkeys-lru eviction so the cache automatically removes the least recently used keys when it reaches its memory limit, meaning it never runs out of memory and never requires manual intervention. For WordPress sites, Redis stores the results of every database query after the first execution so subsequent page loads retrieve data from memory rather than querying MySQL or MariaDB again, typically reducing database load by 50 to 80 percent on busy sites.

Warning Redis persistence is disabled on CloudSonic as it is configured as a pure cache; do not use Redis to store data you cannot afford to lose on a server restart.

Useful Commands

redis-cli -s /run/redis/redis-server.sock -a $(cat /etc/redis/auth.conf) ping
redis-cli -s /run/redis/redis-server.sock -a $(cat /etc/redis/auth.conf) info memory