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.

CLIENT SETNAME

Last updated
CLIENT SETNAME connection-name
Group
Connection
Complexity
O(1)
Arity
3 (exactly, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

CLIENT SETNAME names the current connection. The name appears as name= in CLIENT LIST and CLIENT INFO, and in SLOWLOG GET entries, which makes it much easier to tell which application or worker a connection belongs to. An empty string removes the name.

The name cannot contain spaces, newlines or other non-printable characters, so that CLIENT LIST stays easy to parse. HELLO can set the name too, with its SETNAME option.

Case Reply (RESP2 and RESP3)
Name set Simple string OK
Name with a space or special character Error ERR Client names cannot contain spaces, newlines or special characters.
127.0.0.1:6379> CLIENT SETNAME billing-worker-3
OK
127.0.0.1:6379> CLIENT GETNAME
"billing-worker-3"
127.0.0.1:6379> CLIENT SETNAME "billing worker"
(error) ERR Client names cannot contain spaces, newlines or special characters.

Same as Redis 7 and Valkey 8.

CLIENT GETNAME, CLIENT SETINFO, CLIENT LIST, HELLO