PING

PING [message]
Available since:
Redis Open Source 1.0.0
Time complexity:
O(1)
ACL categories:
@fast, @connection,
Compatibility:
Redis Software and Redis Cloud compatibility

This command returns the bulk string PONG if no argument is provided, otherwise it returns a copy of the provided message as a bulk string.

This command is useful for:

  1. Testing whether a connection is still alive.
  2. Verifying the server's ability to serve data - an error is returned when this isn't the case (for example, during load from persistence data or accessing a stale replica).
  3. Measuring latency.

If the client is subscribed to a channel or a pattern, it will instead return a multi-bulk string with PONG in the first position and an empty bulk string in the second position, unless an argument is provided, in which case it returns a copy of the argument.

Optional arguments

message

A message to return instead of PONG.

Examples

PING

PING "hello world"

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
✅ Standard
✅ Active-Active
✅ Standard
✅ Active-Active

Return information

Any of the following:

RATE THIS PAGE
Back to top ↑