Skip to content

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 grep to find the Redis process in the system list.
  • Port check: Use netstat -tlanp 6379 or lsof -i:6379 to 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]

  1. Navigate to the source directory: cd src
  2. Launch the CLI: ./redis-cli
  3. Send a ping command:
    redis> ping
    PONG
    
    A response of PONG indicates 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]