Easy Tutorial
❮ Server Config Set Lists Brpoplpush ❯

Redis Ping Command

Redis Connection

The Redis Ping command sends a PING from the client to the Redis server. If the server is operating normally, it will return a PONG.

It is commonly used to test if 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 Versions

= 1.0.0

Return Value

Returns a PONG if the connection is normal, otherwise returns a connection error.

Example

# Normal connection between client and server

redis 127.0.0.1:6379> PING
PONG

# Abnormal connection between client and server (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

Redis Connection

❮ Server Config Set Lists Brpoplpush ❯