What is Redis? Fast In-Memory Database
Last updated: 31 December 2025
What is Redis?
Redis is an extremely fast in-memory database that stores data in working memory (RAM) instead of on a hard drive. It stands for Remote Dictionary Server and functions as a powerful caching solution for websites and applications. By storing data in RAM, Redis can fetch and store information millions of times per second, which traditional databases cannot match.
For web hosting, Redis is mainly used as object cache for WordPress and other CMSs. Instead of executing the same database queries at every pageview, the results are stored in Redis. This dramatically reduces server load and makes websites significantly faster. Professional WordPress sites almost always run on Redis or the comparable Memcached.
How Redis Works
Redis runs as a service on your server and stores data as key-value pairs in memory. This is similar to a giant hashtable where you can look up values lightning-fast via their key. For WordPress this means for example that menu items, widget content, and database query results are stored under a unique key.
When your WordPress site needs a menu, it first checks Redis: is there a cached version with key "site_menu_v1"? If yes, use that and skip the MySQL query. If no, fetch the menu from MySQL, store it in Redis for next times, and show it to the visitor. This flow happens automatically via WordPress plugins.
Redis supports different data structures besides simple key-value pairs. You can use lists, sets, sorted sets, and hashes. This makes Redis much more versatile than simple caching systems. For complex applications needing for example real-time leaderboards or message queues, Redis is ideal.
Data persistence is optionally configurable. By default, Redis stores everything only in memory, which disappears at a server restart. For caching this is acceptable. But you can also configure Redis to periodically write snapshots to disk, making data persist. This makes Redis suitable for more than just caching.
Benefits of Redis
Speed is the biggest advantage. Redis fetches data in microseconds where MySQL databases need milliseconds to seconds for complex queries. For a WordPress site this means pages load 3-5x faster with Redis object cache activated.
Scalability improves enormously with Redis. A WordPress site without object cache gets overloaded at 50-100 concurrent visitors. With Redis the same site scales to 500-1000+ visitors before performance degrades. This means you can grow longer before having to upgrade your server.
TTFB (Time To First Byte) drops significantly. Database queries are often the biggest bottleneck in server response time. By caching these queries in Redis, your server responds 200-500ms faster. Visitors notice this improvement directly and Google appreciates it in rankings.
Flexibility is another plus. Redis works not only for WordPress but for virtually any application. From session storage to message queues, from pub/sub systems to full-page caching. This versatility makes Redis valuable for diverse hosting scenarios.
Installing and Configuring Redis
With managed WordPress hosting, Redis is often pre-installed and configured. Providers like Kinsta, WP Engine, and Cloudways activate Redis with one click or have it on by default. Check your hosting dashboard for Redis options.
With VPS or dedicated servers you install Redis manually via SSH. For Ubuntu/Debian use: sudo apt install redis-server. For CentOS/RHEL: sudo yum install redis. After installation start the service with sudo systemctl start redis and ensure it starts automatically with sudo systemctl enable redis.
For WordPress you need an object cache plugin that communicates with Redis. Redis Object Cache by Till Krüss is the most popular free option. Install the plugin, activate it, and click "Enable Object Cache". The plugin automatically detects your Redis installation and configures the connection.
Test if Redis works via the plugin dashboard or SSH. With redis-cli ping you get "PONG" back if Redis is running. In the WordPress plugin you see statistics like cache hits, cache size, and uptime. A good hit ratio is 85-95%, meaning most queries come from cache.
Redis vs Memcached
Both systems are in-memory caching solutions but with subtle differences. Redis supports more complex data structures (lists, sets, hashes) where Memcached only knows key-value pairs. For simple WordPress object caching this matters little, but for advanced use cases Redis wins.
Redis offers data persistence, Memcached doesn't. If your server restarts, Memcached loses all data. Redis can save snapshots. For pure caching this isn't critical, but if you also use Redis for sessions or other semi-permanent data, persistence is valuable.
Performance is comparable for simple operations. Both fetch data in microseconds. For complex operations or large datasets, Redis is sometimes faster through better memory efficiency and advanced data structures.
In popularity, Redis wins in 2025. More hosting providers support Redis, more plugins are optimized for Redis, and the community is larger. For new projects, Redis is therefore the safer choice, unless you need specific Memcached advantages.
Using Redis Optimally
Set an appropriate memory limit. Redis uses as much memory as available, which can choke other processes. Configure maxmemory in redis.conf, for example maxmemory 512mb for a VPS with 2GB RAM. Always leave enough memory for PHP and MySQL.
Choose the right eviction policy. When Redis fills up, it must remove old data to make space. The allkeys-lru policy removes the least recently used keys, ideal for caching. Configure this via maxmemory-policy allkeys-lru in redis.conf.
Monitor Redis performance via the INFO command in redis-cli. Here you see memory usage, connected clients, hit/miss ratio, and countless other metrics. If your hit ratio drops below 80%, investigate why so many queries miss the cache.
Consider Redis clustering for very high traffic. At tens of thousands of visitors per second, one Redis instance can become a bottleneck. Redis Cluster distributes data across multiple Redis nodes. This is however only needed at enterprise scale websites.
Redis Troubleshooting
If Redis uses a lot of memory and your server becomes slow, don't blindly increase the memory limit. First check if your cache is efficient. You can remove old or unnecessary keys. Monitor which keys take up the most space with redis-cli --bigkeys.
With "connection refused" errors, first check if Redis is running: sudo systemctl status redis. If not running, start it: sudo systemctl start redis. Also check if your firewall blocks Redis access on port 6379.
Performance problems from too many connected clients are solved by connection pooling. PHP persistent connections help: instead of opening a new Redis connection at every request, you reuse existing connections. The Redis Object Cache plugin does this automatically.
Data inconsistency between Redis and MySQL sometimes happens after cache flush. After large database imports or migrations, flush Redis completely: redis-cli FLUSHALL. This forces WordPress to recache everything with the new data.
Redis Security
By default, Redis only listens on localhost (127.0.0.1), which is safe. If you make Redis externally accessible, definitely set a password. Add to redis.conf: requirepass YourStrongPassword. Without password anyone can access your Redis instance.
Disable dangerous commands in production. Commands like FLUSHALL and CONFIG can be catastrophic if malicious actors gain access. Rename these in redis.conf: rename-command FLUSHALL "" disables it completely.
Update Redis regularly. Outdated versions have known security vulnerabilities. With managed hosting this happens automatically. With your own VPS check: redis-cli --version and compare with the latest release on redis.io.
Monitor Redis logs for suspicious activity. Unusual connections, failed authentication attempts, or strange commands can indicate attacks. Logs are usually found in /var/log/redis/ or as configured in redis.conf.
Redis and WordPress Performance
For WordPress, Redis is especially valuable for sites with high traffic or complex queries. A simple blog with 100 visitors per day notices little difference. A webshop with 10,000 visitors per day sees dramatic improvement.
Combine Redis with page caching for maximum speed. Redis caches database queries, page caching caches complete HTML. Together they ensure lightning-fast pages. Plugins like WP Rocket support both methods simultaneously.
Test performance before and after Redis implementation. Measure TTFB, page load time, and server response. Tools like GTmetrix or Query Monitor show exactly how much faster your site becomes. Expect 30-60% speed gain for average WordPress sites.
For WooCommerce webshops, Redis is essential. Product catalogs with thousands of items generate heavy database queries. Redis caches these queries, making category pages and search results load instantly instead of buffering for seconds.
Redis Hosting Requirements
Not all hosting packages support Redis. Budget shared hosting rarely offers it. When choosing hosting providers, explicitly check if Redis is available. Managed WordPress hosting often includes it by default.
You need at least 256MB RAM for Redis, preferably 512MB-1GB. This memory allocation comes on top of what PHP and MySQL need. For a WordPress site with Redis, count on at least 2GB total server RAM, preferably 4GB for comfort.
With cPanel, Plesk, or DirectAdmin hosting, ask support if Redis can be installed. Some providers offer it as a paid add-on, others as a standard feature with higher packages.
VPS and dedicated servers give complete control over Redis configuration. You install and configure it exactly to your preferences. For serious performance optimization and full control, own server hosting with Redis is the best option. Check our comparison for hosting with Redis support.
Frequently Asked Questions
How much does web hosting cost on average?
Web hosting costs between €3 and €15 per month for shared hosting on average. VPS hosting starts around €10-€20 per month, and dedicated servers from €50 per month.
Can I upgrade to a different package later?
Yes, with most hosting providers you can easily upgrade to a larger package when your website grows. This can usually be done without downtime.
Is Dutch hosting better than foreign hosting?
For Dutch visitors, Dutch hosting is often faster due to the shorter distance. Additionally, communication with support is easier and you comply with GDPR legislation.
Was this article helpful?
Compare hosting packages directly to find the best choice for your situation.
Related articles
What is web hosting? Explanation for beginners
Discover what web hosting is and how it works. Complete explanation about servers, domains and different hosting types for beginners.
What is VPS Hosting?
VPS hosting explained: what is a Virtual Private Server, who is it suitable for and what are the advantages compared to shared hosting?
What is an SSL Certificate?
Everything about SSL certificates: what is SSL, why do you need it and how do you recognize a secure website? Essential for every website.
What is Uptime in Web Hosting?
What does uptime mean in web hosting? Learn about uptime percentages, SLA guarantees and why 99.9% uptime is important for your website.
How much storage do I need for my website?
Discover how much disk space you really need for your website. Practical guide with examples per website type.