Configuring Valkey Cluster on Multi-VPS ARM for Cost and Performance Optimization at 1 Million Requests/Second
We will build a Valkey cluster on multiple ARM-based VPS servers to achieve processing performance of up to 1 million requests per second with optimized costs. This guide covers...
Image credit: Schäferle · Pixabay Content License
We will build a Valkey cluster on multiple ARM-based VPS servers to achieve processing performance of up to 1 million requests per second with optimized costs. This guide covers hardware setup, operating system configuration, Valkey installation, cluster setup, load balancing, and performance optimization for ARM environments. The guide is intended for small and medium enterprises (SMEs) looking to deploy an effective, cost-efficient caching system using open-source technology.
Introduction and Objectives
Valkey is a high-performance fork of Redis, optimized for scalability and speed. To handle large volumes of real-time queries, deploying a Valkey cluster across multiple ARM-based VPS servers is an effective solution to reach 1 million requests per second. ARM architecture is power-efficient, making it ideal for low-cost cloud VPS platforms such as NVMe Cloud VPS for Docker, Nginx & Databases, significantly reducing operational expenses. The objective of this guide is to set up a stable Valkey cluster, automate configuration, and optimize performance on ARM-based infrastructure.
Requirements and Initial Setup
To successfully deploy, the following conditions are required:
- At least 3 ARM-based VPS servers (using platforms such as /en/vps)
- Operating system: NixOS or Ubuntu 22.04 LTS
- Software: Valkey (version 7.0 or higher), systemd, net-tools, htop, vim
- Network setup: VPS servers must communicate over internal network, port 6379 (Valkey) must be open
Operating system setup: On each VPS, update the system and install necessary tools:
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential tcl8.6 wget
Refer to the guide on configuring NixOS flakes to clone 100 identical VPS servers in 60 seconds at /en/blog/cach-cau-hinh-nixos-flakes-de-nhan-ban-100-may-chu-vps-giong-het-nhau-trong-60-giay.
Valkey Setup and Cluster Configuration
1. Install Valkey from source:
wget https://download.redis.io/releases/valkey-7.0.11.tar.gz
tar xzf valkey-7.0.11.tar.gz
cd valkey-7.0.11
make
sudo make install
2. Create a Valkey configuration file (`valkey.conf`) on each node:
port 6379
daemonize yes
pidfile /var/run/valkey.pid
logfile /var/log/valkey.log
dir /var/lib/valkey
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
cluster-slave-validity-factor 10
appendonly yes
appendfilename "appendonly.aof"
3. Start Valkey and verify status:
valkey-server /etc/valkey/valkey.conf
valkey-cli ping
4. Create the cluster using the command:
valkey-cli --cluster create <IP1:6379> <IP2:6379> <IP3:6379> --cluster-replicas 1
Refer to the guide on fleet management and bulk VPS configuration automation with Ansible at /en/blog/fleet-management-quan-tri-va-cau-hinh-hang-loat-vps-tu-dong-bang-ansible.
Performance Optimization and Benchmarking
To achieve 1 million requests per second, the following optimizations are required:
- System setup: Increase file descriptor limits, configure kernel for high performance.
- Valkey: Optimize memory usage, enable AOF and RDB, configure maxmemory.
- Network: Use internal connections, enable TCP keepalive.
Perform performance testing using the `valkey-benchmark` tool:
valkey-benchmark -h <cluster-ip> -p 6379 -c 100 -n 1000000
Run multiple test iterations and record average requests per second. If performance is below 1 million, adjust memory configuration, thread count, or load balancing settings.
Verification and Troubleshooting
To verify the cluster is operating correctly:
- Run `valkey-cli cluster nodes` to check node status.
- Monitor Valkey logs: `tail -f /var/log/valkey.log`.
- Test network connectivity: `ping <IP>`, `telnet <IP> 6379`.
Troubleshooting steps:
- Connection failure: Check firewall rules, ensure port 6379 is open.
- Cluster not functioning: Verify `cluster-enabled` and `cluster-config-file` settings.
- Low performance: Check CPU, RAM, and I/O resources; optimize memory settings.
Refer to the guide on comprehensive digital transformation for SMEs in 10 months: optimizing ERPNext on Docker VPS clusters at /en/blog/chuyen-doi-so-toan-dien-cho-sme-chi-voi-10thang-toi-uu-hoa-erpnext-tren-cum-docker-vps.
Related infrastructure & engineering guides: NVMe Cloud VPS for Docker, Nginx & Databases
High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-4E
10% VAT included
- CPU: 4 vCPU
- RAM: 8 GB
- SSD: 50 GB NVMe
