Vertical scaling, also known as "scaling up", is a method of adding resources such as more memory or additional CPU power to boost performance. When it comes to Redis, vertical scaling means that you augment the server's capacity where Redis instances are running.
In order to scale Redis vertically, there are several strategies you could consider:
# Stop the current Redis instance service redis-server stop # Upgrade your server (this step will depend on your provider) # Usually involves selecting larger instance/machine type, applying change, and waiting for the restart # Start Redis back up service redis-server start
# Open the Redis configuration nano /etc/redis/redis.conf # Find the setting you want to adjust # Set the 'maxmemory-policy' to control how Redis handles memory usage above 'maxmemory' maxmemory-policy noeviction # Save and exit # Then restart the Redis service service redis-server restart
Remember that vertical scaling has its limitations - at some point, you won't be able to add more resources to a single machine. In this case, you'll need to consider horizontal scaling, which involves adding more machines to your setup.
It's also worth noting that while vertical scaling can improve performance, it can also increase costs, potentially significantly. Therefore, you should carefully monitor the effects of scaling on both your system's performance and your budget to ensure you're achieving the desired improvements without overspending.
If you're looking for a Redis alternative that's more performant and scales vertically, have a look at Dragonfly.
Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.