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 NO-EVICT

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

When maxmemory-clients is set and the clients together hold more than it allows, HotKV closes the clients that hold the most. CLIENT NO-EVICT ON exempts the current connection from that, and OFF removes the exemption. While it is on, the connection shows the e flag in CLIENT LIST. Use it for a connection that must stay up, such as an administration session.

An exempt connection’s memory still counts toward the total. If it is the one that holds too much, the clients that can be evicted are closed in its place, the largest first. Turning it off judges the clients at once, so the connection itself may be closed if it is the largest.

A replica’s link, a connection of an atomic slot migration and another cluster node’s own connection are never evicted and not counted, whatever this says. RESET turns the exemption off. See Client memory.

Case Reply (RESP2 and RESP3)
ON or OFF Simple string OK
Any other value Error ERR syntax error
127.0.0.1:6379> CLIENT NO-EVICT ON
OK
127.0.0.1:6379> CLIENT NO-EVICT maybe
(error) ERR syntax error

Same replies as Redis 7 and Valkey 8. Evictions are counted in the evicted_clients field of INFO stats.

CLIENT NO-TOUCH, CLIENT LIST, Memory and eviction