PING(3valkey)
π PING π
okay bestie, welcome to the Valkey Command Manual β this is the ping(3valkey) page and it's literally the shortest glow-up in the whole protocol. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
ping β returns the server's liveliness response. that's it. that's the whole job. she checks if your fave is still breathing π
πΈ SYNOPSIS πΈ
PING [message]
π¦ DESCRIPTION π¦
So here's the tea: if you don't hand her an argument, she hits you back with PONG. no argument, no problem, just PONG. π
But if you do pass an argument? She returns a copy of it as a bulk. literally just hands it right back to you, unchanged, like a friend returning your hoodie.
This command is lowkey useful for three whole things:
- Testing whether a connection is still alive. is the link still linking?? π
- Verifying the server's ability to serve data β and bestie, an error is returned when this isn't the case. like, for example, during load from persistence, or when you're accessing a stale replica. so if it throws hands, that's your answer. π
- Measuring latency. how fast is she moving?? β
Now the important plot twist, so pay attention: if the client is in RESP2 and is subscribed to a channel or a pattern, she will instead return a multi-bulk with a "pong" in the first position and an empty bulk in the second position β unless an argument is provided, in which case she returns a copy of the argument. yes, really. RESP2 subscription girlies get a whole different reply. iykyk π
π REPLY π
Any of the following, bestie:
valkey-protocol(7)Simple string reply:PONGwhen no argument is provided.valkey-protocol(7)Bulk string reply: the provided argument.
π₯ COMPLEXITY π₯
constant time, no cap. she does not care how big your server is, she answers instantly. iconic behavior honestly π
π ACL CATEGORIES π
@connection @fast
πΈ HISTORY πΈ
- Available since:
1.0.0β an OG. been here since day one fr fr π
β EXAMPLES β
127.0.0.1:6379> PING
PONG
127.0.0.1:6379>
127.0.0.1:6379> PING "hello world"
"hello world"
see?? she said it right back. no notes. π
π SEE ALSO π
auth(3valkey), client(3valkey), client-caching(3valkey), client-capa(3valkey), client-getname(3valkey), client-getredir(3valkey), client-help(3valkey), client-id(3valkey), client-import-source(3valkey), client-info(3valkey), client-kill(3valkey), client-list(3valkey), client-no-evict(3valkey), client-no-touch(3valkey), client-pause(3valkey), client-reply(3valkey), client-setinfo(3valkey), client-setname(3valkey), client-tracking(3valkey), client-trackinginfo(3valkey), client-unblock(3valkey), client-unpause(3valkey), echo(3valkey), hello(3valkey), quit(3valkey), reset(3valkey), select(3valkey)
and that's the whole page, bestie!! π§ this was Valkey 9.0.0, dated 2025-10-21, and honestly? she ate. go ping something and feel alive. mwah π
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms