Redis troubleshooting and verification commands¶
After starting Redis, you can verify that the server is running correctly and troubleshoot common configuration issues using specific system commands and log analysis.
Verifying Redis is Running¶
To confirm the Redis server has successfully started, you can check for the active process or the network port.
- Process check: Use
ps -ef | grep redis | grep -v grepto find the Redis process in the system list. - Port check: Use
netstat -tlanp 6379orlsof -i:6379to verify if the default Redis port (6379) is listening^[600-developer-big-data-redis-redis-01-install.md].
Basic Verification¶
To interactively verify that the server is responding to commands, use the redis-cli tool.^[600-developer-big-data-redis-redis-01-install.md]
- Navigate to the source directory:
cd src - Launch the CLI:
./redis-cli - Send a ping command:
A response of
redis> ping PONGPONGindicates the server is operational^[600-developer-big-data-redis-redis-01-install.md].
Common Troubleshooting Warnings¶
Upon starting Redis, you may encounter warnings related to kernel parameters or system settings. Below are common issues and their fixes.
TCP Backlog Warning¶
If you see the warning The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128, it means the Linux kernel parameter net.core.somaxconn is too low^[600-developer-big-data-redis-redis-01-install.md].
Fix:
1. Edit /etc/sysctl.conf.
2. Set the parameter: net.core.somaxconn=32768.
3. Apply changes: sysctl -p^[600-developer-big-data-redis-redis-01-install.md].
Overcommit Memory Warning¶
If background saves fail under low memory conditions, Redis may warn: overcommit_memory is set to 0!^[600-developer-big-data-redis-redis-01-install.md].
Fix:
Add vm.overcommit_memory = 1 to /etc/sysctl.conf and apply it with sysctl vm.overcommit_memory=1 or reboot^[600-developer-big-data-redis-redis-01-install.md].
Transparent Huge Pages (THP) Warning¶
Redis performs poorly with Transparent Huge Pages enabled. The warning usually suggests running echo never > /sys/kernel/mm/transparent_hugepage/enabled^[600-developer-big-data-redis-redis-01-install.md].
Fix:
1. Run the command: echo never > /sys/kernel/mm/transparent_hugepage/enabled as root.
2. Add this command to /etc/rc.local to make it persistent across reboots^[600-developer-big-data-redis-redis-01-install.md].
Sources¶
^[600-developer-big-data-redis-redis-01-install.md]