CLIENT-ID(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

✨ CLIENT-ID ✨

okay bestie so this is a page from the Valkey Command Manual (the 3valkey girlies know πŸ’…), and it's all about the CLIENT-ID command. sit down, hydrate, let's get into it πŸ“


🌸 NAME 🌸

client-id β€” returns the unique client ID of the connection. that's it. that's the whole vibe. your very own connection's little government name πŸ˜­πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

CLIENT ID

no args, no drama, no flags. she's low maintenance, she's iconic, she just is ✨


πŸ’œ DESCRIPTION πŸ’œ

so like, this command just hands you the ID of the current connection. that's the whole job. but don't sleep on it, because every connection ID comes with certain guarantees, and these are important, no cap:

  1. It is never repeated. so if CLIENT ID gives you the same number twice, you can be absolutely sure that the underlying client did not disconnect and reconnect β€” it's still the same connection, fr fr. same girl, same vibe check, same connection 🫢
  2. The ID is monotonically incremental. if one connection's ID is greater than another connection's ID, it is guaranteed that the second connection was established with the server at a later time. so bigger number = showed up later, periodt. ⏰

this command is especially useful together with valkey-client-unblock(7) CLIENT UNBLOCK β€” go check the CLIENT UNBLOCK command page for a whole pattern involving the two of them, iykyk πŸ‘‘


🌈 REPLY 🌈

valkey-protocol(7) Integer reply: the ID of the client. a whole number, that's your baby's ID πŸ’«


⭐ COMPLEXITY ⭐

O(1)

constant time, bestie. she's fast, she's effortless, she ate πŸ”₯


πŸŽ€ ACL CATEGORIES πŸŽ€

@connection @slow

(not me side-eyeing the @slow tag on an O(1) command πŸ™ˆ it's giving "categories are categories")


πŸ’… HISTORY πŸ’…

  • Available since: 5.0.0 β€” she's been around, she's a legend, she's not new here πŸ‘‘

✨ EXAMPLES ✨

127.0.0.1:6379> CLIENT ID
(integer) 2873

look at that number. gorgeous. iconic. your number πŸ’–


🧚 SEE ALSO 🧚


and that's the whole page, bestie!! this was Valkey 9.0.0, dated 2025-10-21. go ask your connection for its ID, she'll tell you πŸ’…βœ¨ mwah, bye!! πŸŽ€πŸ’–πŸ¦‹
πŸ“¦ where this page comes from