-- Learning not just technology, but dreams!
Redis Ping Command
The Redis PING command sends a PING message from the client to the Redis server. If the server is running normally, it will respond with a PONG.
This command is typically used to test whether the connection to the server is still active, or to measure latency.
Syntax
The basic syntax for the Redis PING command is as follows:
redis 127.0.0.1:6379> PING
Available Version
>= 1.0.0
Return Value
If the connection is normal, it returns a PONG. Otherwise, it returns a connection error.
Examples
# Client and server connection is normal
redis 127.0.0.1:6379> PING
PONG
# Client and server connection is abnormal (network issue or server not running properly)
redis 127.0.0.1:6379> PING
Could not connect to Redis at 127.0.0.1:6379: Connection refused
AI is thinking...
YouTip