Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

PING

Last updated
PING [message]
Group
Connection
Complexity
O(1)
Arity
-1 (at least 1 words, counting the command name)
Flags
fast
HotKV Cloud
All plans
On-Premise
no license needed

PING checks that the server is reachable and processing commands. Without an argument it replies PONG. With an argument it replies with that argument. Health checks, connection pools and latency probes use it.

PING also works on a connection that is subscribed to channels (see SUBSCRIBE), where most other commands are refused.

Case RESP2 RESP3
No argument Simple string PONG Simple string PONG
With message message as a bulk string message as a bulk string
No argument, connection subscribed Array of "pong" and an empty string Simple string PONG
With message, connection subscribed Array of "pong" and message message as a bulk string

More than one argument is refused with ERR wrong number of arguments for 'ping' command.

127.0.0.1:6379> PING
PONG
127.0.0.1:6379> PING "are you there?"
"are you there?"

Same replies as Redis 7 and Valkey 8, including the two-element reply on a subscribed RESP2 connection.

ECHO, HELLO, TIME