CLIENT NO-EVICT
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.
Return value
Section titled “Return value”| Case | Reply (RESP2 and RESP3) |
|---|---|
ON or OFF |
Simple string OK |
| Any other value | Error ERR syntax error |
Examples
Section titled “Examples”127.0.0.1:6379> CLIENT NO-EVICT ONOK127.0.0.1:6379> CLIENT NO-EVICT maybe(error) ERR syntax errorCompatibility
Section titled “Compatibility”Same replies as Redis 7 and Valkey 8. Evictions are counted in the
evicted_clients field of INFO stats.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.