面向生产环境的 Redis 实战指南,直击"无 TTL 内存泄漏、淘汰策略错配、集群跨槽报错、原子性陷阱、大 Key 拖垮 eviction"五大高频生产事故。提供决策树、模式库、故障排查清单,而非零散命令罗列。 核心能力包括 TTL 纪律规范(每个缓存键必设过期)、淘汰策略决策树(allkeys-lru/vol...
数据分析
Redis Store
试用为 Redis 数据建模、命令实现与运维提供决策树、原子性规则和故障排查清单。
它能做什么
涵盖 Redis 数据结构选型、原子命令、Lua 脚本与流水线,以及缓存、会话存储、作业队列、分布式锁、限流、排行榜、去重等常见实现模式。给出 maxmemory、淘汰策略、持久化、复制、Sentinel、Cluster 的运维要点,以及向 ElastiCache、MemoryDB、Redis Cloud、Upstash、Memorystore、Azure 等托管服务和 Valkey 分支迁移的路径。针对写入 OOM、延迟飙升、键空间被淘汰、故障转移丢数据、缓存击穿、副机不同步等问题,提供从症状到原因的排查步骤。不涉及存储无关的缓存分层设计、限流算法选型以及关系建模。
什么时候用它
- 为新功能选 Hash、Stream、Sorted Set、Bitmap 还是 HyperLogLog
- 诊断 noeviction 策略下的写入 OOM 或 evicted_keys 持续上涨
- 用 Stream 消费组搭建带重试与确认的作业队列
- 把单机 Redis 迁移到集群、新版本,或托管服务、Valkey
技能文档
User preferences and memory live in ~/Clawic/data/redis-store/ (see setup.md on first use, memory-template.md for the file format). If you have data at an old location (~/redis-store/ or ~/clawic/redis-store/), move it to ~/Clawic/data/redis-store/.
When To Use
- Choosing how to model something in Redis: hash vs JSON string vs separate keys, sorted set vs stream, set vs bitmap vs HyperLogLog
- Writing Redis commands, pipelines, Lua scripts or Functions, and getting atomicity right
- Building the standard recipes: cache, session store, job queue, distributed lock, rate limiter, leaderboard, dedup/idempotency key, counter
- Operating a server: maxmemory and eviction, persistence and backups, ACLs, connection limits, replication, Sentinel, Cluster
- A production incident: OOM on writes, latency spike, unresponsive server, keyspace evicted or wiped, failover that lost writes, replica that never syncs
- Migrating: standalone to cluster, version upgrade, a managed provider (ElastiCache, MemoryDB, Redis Cloud, Upstash, Memorystore, Azure) or the Valkey fork
- Not for store-agnostic cache hierarchy design (caching), rate-limit algorithm selection (rate-limiting), or relational modeling (pg, sql)
Quick Reference
| Situation | Play |
|---|---|
Writes fail with OOM command not allowed | maxmemory reached under noeviction (the default policy) — Expiration And Eviction, then memory-eviction.md |
| Memory grows forever, hit rate fine | Keys written without a TTL, or a stream nobody trims (→ memory-eviction.md, queues.md) |
| Keys disappear before their TTL | Eviction, not expiry: check evicted_keys in INFO stats (→ memory-eviction.md) |
| Keys never expire | A plain SET on an existing key clears its TTL — use SET ... KEEPTTL (Redis >=6.0) or re-set it (→ keys-ttl.md) |
| Server froze for seconds | An O(N) command on a big collection, a fork, or swap — Latency Triage |
| Need to walk the keyspace | SCAN cursor loop with COUNT 500, never KEYS (→ cli.md) |
| Which structure for this data | Choosing The Data Structure |
| Job queue with retries and acks | Stream + consumer group; a List only for fire-and-forget (→ queues.md) |
| Subscribers miss messages sent while down | Pub/Sub is at-most-once and stores nothing — move to Streams (→ pubsub.md) |
| Two workers must not run at once | SET lock NX EX + Lua release comparing the token (→ locks.md) |
| Read-modify-write race | One atomic command or one Lua script; MULTI is not a rollback (→ scripting.md) |
CROSSSLOT keys ... don't hash to the same slot | Hash-tag the related keys: {user:1}:profile (→ cluster.md) |
MOVED / ASK reaching the app | Client is not cluster-aware, or its slot map is stale (→ cluster.md) |
MISCONF ... unable to persist to disk | The last background save failed; writes are refused on purpose (→ persistence.md) |
| Writes acknowledged then lost after failover | Replication is asynchronous by default — WAIT, min-replicas-to-write (→ high-availability.md) |
| Latency spike with no CPU load | Fork for RDB/AOF rewrite, transparent huge pages, or swap (→ performance.md) |
| Throughput far below 10^5 ops/s | Round trips, not Redis: pipeline or use multi-key commands (→ performance.md) |
| Everything recomputes at once after a deploy or restart | Cache stampede: TTL jitter + single-flight recompute (→ caching.md) |
| Instance was reachable from the internet | Treat as compromised, then bind, ACL, TLS (→ security.md) |
Provider rejects CONFIG SET, DEBUG, SHUTDOWN | Managed capability matrix (→ managed-redis.md) |
| Tests are flaky or slow around Redis | Real server in a container, unique prefix per test, no shared FLUSHDB (→ testing.md) |
| Anything else | INFO, SLOWLOG GET 10, LATENCY DOCTOR, MEMORY DOCTOR before changing anything; reproduce in redis-cli before blaming the client library |
Depth on demand, by phase:
- Model —
data-types.mdwhich structure wins and what it costs ·keys-ttl.mdkey design, expiry semantics, SCAN, keyspace notifications ·patterns.mdsessions, leaderboards, counters, dedup, autocomplete, geo ·modules.mdJSON, Search, vectors, Bloom, TimeSeries - Build —
caching.mdcache-aside, invalidation, stampede, client-side caching ·queues.mdStreams, consumer groups, retries, delayed jobs ·pubsub.mdfan-out, sharded Pub/Sub, notifications ·locks.mddistributed locks and fencing ·scripting.mdatomicity, MULTI, Lua, Functions ·testing.mdtest isolation and CI - Operate —
memory-eviction.mdmaxmemory, eviction, big keys, fragmentation ·persistence.mdRDB, AOF, backups, restore drills ·connections.mdpooling, timeouts, buffers, TLS ·security.mdACLs, exposure, command policy ·cli.mdthe redis-cli forensics toolkit ·managed-redis.mdElastiCache, MemoryDB, Redis Cloud, Upstash, Memorystore, Azure - Scale and recover —
cluster.mdslots, hash tags, resharding ·high-availability.mdreplication, Sentinel, failover, durability ·performance.mdlatency triage, pipelining, command cost ·incidents.mdsymptom-to-cause playbooks ·migrations.mdupgrades, standalone-to-cluster, provider and Valkey moves
Core Rules
- Every key gets a TTL or a named owner that deletes it. Redis never reclaims what nobody expires. Budget:
memory ≈ keys × (60-100 bytes of key overhead + value size), so 10M TTL-less session keys of 200 bytes cost roughly 3 GB whether or not anyone reads them. Check:redis-cli INFO keyspacereportskeys=N,expires=Mper db — a largeN − Mis the leak. - Set
maxmemoryand a policy before production. WithoutmaxmemoryRedis grows until the kernel swaps or the OOM killer takes it. Sizing: with fork-based persistence enabled,maxmemory≤ 55-60% of host RAM (a copy-on-write fork can approach a second copy of the dataset in the worst case); a pure cache with persistence off can go to ~80%. Default policy isnoeviction, which turns "full" into failed writes. - One command, one atomic unit —
MULTIis not a rollback. A runtime error insideEXEC(wrong type, OOM) does not undo the commands that already ran. Prefer a single atomic command (INCR,SET NX,LMOVE), then Lua, thenWATCH-and-retry. Check: if your logic reads a value and writes a value derived from it, it needs one of the three. - Never run an O(N) command against an unbounded collection. Command execution is serial: one
KEYSorHGETALLover 1M elements stalls every client for the duration, and at roughly 10^5-10^6 elements that is tens to hundreds of milliseconds. Replacements:SCAN/HSCAN/SSCAN/ZSCANwithCOUNT,UNLINKinstead ofDELfor big keys,LRANGEwith real bounds. - Round trips, not Redis, are your latency. Unpipelined cost ≈
n × RTT: 1000 sequentialGETs over a 0.5 ms network is 500 ms of wall time while the server spends under 10 ms. Batch with a pipeline (500 commands per flush is a sane default),MGET/HMGET, or a Lua script that does the loop server-side. - A lock needs a unique token, a TTL longer than the work, and a compare-and-delete release. TTL ≥ 3× the p99 duration of the critical section, renewed at 1/3 of the TTL by the holder. Releasing with a plain
DELdeletes whatever lock exists — including the one the next worker just acquired after your TTL expired. The instance must benoeviction: that mandatory TTL is what makes a lock the first victim undervolatile-*(→locks.md). - Replication is asynchronous: an acknowledged write can be lost in failover. The master replies before replicas see the write.
WAIT 1 100blocks until one replica acknowledges (still not consensus — a partitioned master can acknowledge and lose),min-replicas-to-write 1+min-replicas-max-lag 10refuses writes when nobody is listening. Choose the data-loss budget explicitly (→high-availability.md). - Persistence is a data-loss budget, not a checkbox. RDB alone loses everything since the last snapshot (default save points fire at 3600s/1 change, 300s/100, 60s/10000). AOF with
appendfsync everysecloses about one second and is the default balance;alwayscosts an fsync per write. Both enabled = RDB for fast restore, AOF for the tail — Redis restores from AOF when it is on (→persistence.md).
Choosing The Data Structure
Pick the smallest structure whose access pattern matches the query you will actually run. Encoding thresholds and per-type memory math: data-types.md.
| Need | Structure | Wins because | Cost / limit |
|---|---|---|---|
| Blob, counter, flag | String | INCR, SETNX, GETEX, APPEND are single atomic ops | 512 MB max value; whole-value read-modify-write if you store JSON |
| Object with independently updated fields | Hash | HSET/HINCRBY touch one field; small hashes are stored as a packed listpack | Field-level TTLs need Redis >=7.4; otherwise the TTL is per key |
| FIFO/LIFO of jobs, capped log | List | LPUSH/BLMOVE are O(1) at the ends | No ack, no replay; index access is O(N) |
| Membership, tags, dedup set | Set | SISMEMBER O(1), SINTER/SDIFF server-side | Set ops are O(N) in the inputs — bound them |
| Ranking, sliding window, priority queue, time index | Sorted Set | Score-ordered range queries, O(log N) writes | Scores are IEEE-754 doubles: integers exact only to 2^53 |
| Event log with consumers, acks, replay | Stream | Consumer groups, pending list, XAUTOCLAIM recovery | Entries live until trimmed — MAXLEN/MINID or it grows forever |
| Daily-active flags, per-user boolean matrix | Bitmap (String) | 1 bit per user; BITCOUNT/BITOP server-side | 2^32 bits (512 MB) ceiling; sparse ids waste space |
| Approximate unique counts | HyperLogLog | 12 KB per counter at 0.81% standard error, mergeable with PFMERGE | No membership test, no exact count |
| Radius / nearest search | Geo (Sorted Set) | GEOSEARCH (Redis >=6.2) by radius or box | Geohash precision; still one sorted set under the hood |
| Query by field, full text, vectors | JSON + Search modules | Secondary indexes over hashes/JSON | Module availability differs per deployment (→ modules.md) |
| Anything else | Start with Hash or Sorted Set | They cover object and ordered-collection access | Re-check against this table once the query pattern is known |
Latency Triage
Run in order; skipping to step 4 tunes the wrong thing.
- Separate client-side from server-side:
redis-cli --latency -h(round-trip as seen from a client) vsredis-cli --intrinsic-latency 100on the server box (what the kernel and CPU alone cost). A high intrinsic number means the host, not Redis. SLOWLOG GET 10— the log records commands overslowlog-log-slower-than, default 10000 microseconds, keeping the lastslowlog-max-len128. Its times exclude network, so an entry here is genuinely a slow command.LATENCY LATESTandLATENCY DOCTORafter settinglatency-monitor-threshold 100(default 0 = disabled). Events namedfork,aof-fsync-always,expire-cyclename their own cause.INFO commandstats— sort byusec_per_call, then multiply bycalls: a 0.2 ms command called 5k/s consumes a full second of CPU per second of wall time — the entire single thread — and beats any 40 ms outlier as a target.- Fork suspicion:
INFO statslatest_fork_usec. Fork cost tracks page-table size, on the order of 10-20 ms per GB of RSS on ordinary Linux VMs, and transparent huge pages multiply both the pause and the copy-on-write memory (→persistence.md). - Still unexplained: check swap (
used_memory_rssfar aboveused_memorywhile the host swaps),mem_fragmentation_ratiobelow 1.0 means swapping, andblocked_clientsfor a queue ofBLPOP/BRPOPLPUSHwaiters (→performance.md).
Expiration And Eviction
Two different mechanisms produce the same symptom, "my key is gone", and have opposite fixes.
- Expiry removes keys that had a TTL. Redis mixes lazy deletion on access with an active cycle that runs at
hz(default 10) times per second: it samples 20 keys with a TTL per database, deletes the expired ones, and repeats immediately while more than 25% of the sample was expired. Consequence: a key can outlive its TTL in memory for a moment, but never in reads — Redis never returns an expired value. - Eviction removes keys because
maxmemorywas hit, and depends entirely onmaxmemory-policy:noeviction(default: writes fail with OOM),allkeys-lru/allkeys-lfu/allkeys-random,volatile-lru/volatile-lfu/volatile-random/volatile-ttl. Diagnose withINFO stats:expired_keysrising is expiry,evicted_keysrising is eviction. - The trap the
volatile-*policies set: they can only evict keys that carry a TTL. A mixed workload where the persistent half has no TTL and the cache half does will refuse writes with OOM even though most of memory is evictable — the eviction candidate pool was empty. - Locks and queues need a
noevictioninstance, full stop. Underallkeys-*a lock key or a stream is an ordinary eviction candidate; undervolatile-*a lock is the first victim, because the TTL every lock must carry is exactly what puts it in the candidate pool (→locks.md,queues.md). - LRU here is sampled, not true LRU:
maxmemory-samples(default 5) candidates per eviction; raising it to 10 tracks true LRU closely at a small CPU cost. LFU (allkeys-lfu) counts frequency with a logarithmic counter, tuned bylfu-log-factor(default 10) and decayed bylfu-decay-time(default 1 minute) — better for a cache with a hot, stable working set. - Replicas do not expire keys on their own: they wait for the master's
DELand meanwhile answer reads as if the key were gone. A replica'sDBSIZEcan therefore exceed the master's without anything being wrong.
Error Messages
Match on the prefix; message tails change between versions. Full playbooks in incidents.md.
| Reply | Meaning | First move |
|---|---|---|
OOM command not allowed when used memory > 'maxmemory' | Memory limit reached and nothing is evictable | Policy or capacity — Expiration And Eviction |
MISCONF Redis is configured to save RDB snapshots... | The last background save failed; stop-writes-on-bgsave-error yes refuses writes | Fix the disk, permissions, or dir, then BGSAVE (→ persistence.md) |
CROSSSLOT Keys in request don't hash to the same slot | Multi-key command over keys in different slots | Hash tag the group, or split into per-key calls (→ cluster.md) |
MOVED 3999 host:port / ASK ... | Slot lives elsewhere (MOVED) or is migrating (ASK) | Use a cluster-aware client and let it refresh the slot map |
BUSY Redis is busy running a script | A Lua script exceeded busy-reply-threshold (default 5000 ms) | SCRIPT KILL if it has not written; otherwise only SHUTDOWN NOSAVE (→ scripting.md) |
LOADING Redis is loading the dataset in memory | Startup or a full resync is reading RDB/AOF | Wait; INFO persistence loading_* fields estimate the remainder |
READONLY You can't write against a read only replica | You are talking to a replica | Client is stale or misrouted (→ high-availability.md) |
WRONGTYPE Operation against a key holding the wrong kind of value | Key namespace collision, or a type change without a migration | Namespace by type (→ keys-ttl.md) |
NOSCRIPT No matching script | EVALSHA after a restart or SCRIPT FLUSH | Fall back to EVAL, or load at connect (→ scripting.md) |
EXECABORT Transaction discarded because of previous errors | A queued command was syntactically invalid | Fix the queued command; note that runtime errors do not abort (Core Rule 3) |
NOAUTH / WRONGPASS / NOPERM | Missing auth, bad credentials, ACL denies this command or key pattern | ACL WHOAMI, ACL GETUSER (→ security.md) |
ERR max number of clients reached | maxclients (default 10000) or the file-descriptor limit | Pool and cap; check leaked connections (→ connections.md) |
NOREPLICAS Not enough good replicas to write | min-replicas-to-write is unsatisfied | Replica health first, never by lowering the setting blindly |
Output Gates
Before emitting Redis commands, a client integration, or a config change:
- Does every key this creates either carry a TTL or have a named deleter?
- Is every read-modify-write one atomic command, one Lua script, or a
WATCHretry loop? - Is every keyspace-wide operation a
SCANloop, neverKEYS, and every large delete anUNLINK? - Under
topology: cluster, do all keys of each multi-key command or script share a hash tag? - Do the locks and queues sit on a
noevictioninstance (neverallkeys-*, nevervolatile-*), and does the code still survive a restart? - Are the round trips bounded — pipeline,
MGET, or a script — rather than one call per item in a loop? - Does anything here claim durability the configured
persistence_modeand replication cannot deliver? - Is a destructive command (
FLUSHALL, pattern delete,CONFIG SET, failover) gated bydestructive_confirm?
Configuration
User-dependent variables. Defaults apply until the user states a preference; store them in ~/Clawic/data/redis-store/config.yaml.
| Variable | Type | Default | Effect |
|---|---|---|---|
| deployment | self-hosted | elasticache | memorydb | redis-cloud | upstash | memorystore | azure | self-hosted | Gates which admin commands exist (CONFIG SET, DEBUG, BGREWRITEAOF) and switches tuning advice to parameter groups or console equivalents (→ managed-redis.md) |
| topology | standalone | sentinel | cluster | standalone | Decides whether multi-key commands, SELECT, plain Pub/Sub and Lua over several keys are safe to emit, and which failover story applies |
| server_version | number (6-8) | 7 | Which version-gated features appear (feature >=X lines): KEEPTTL, GETEX, sharded Pub/Sub, XAUTOCLAIM, Functions, hash-field TTLs |
| client | redis-cli | redis-py | ioredis | node-redis | go-redis | lettuce | jedis | phpredis | redis-cli | The language of every emitted example, plus which pooling and reconnection advice applies (→ connections.md) |
| maxmemory_policy | noeviction | allkeys-lru | allkeys-lfu | volatile-lru | volatile-lfu | volatile-ttl | allkeys-random | volatile-random | noeviction | Whether generated code may assume a key still exists. Anything other than noeviction makes locks, queues and counters unsafe and the warning is emitted: allkeys-* can evict them, and volatile-* is worse for a lock, whose mandatory TTL puts it in the candidate pool (→ locks.md) |
| persistence_mode | none | rdb | aof | both | rdb | The durability claims attached to any recipe, and which backup and restore procedure is offered |
| key_prefix | text | app | The namespace in every generated key (app:user:1:profile); also the prefix used for scoped SCAN and test isolation |
| default_ttl | duration | 1h | The expiry written into generated cache examples, and the base for the ±10% jitter in caching.md |
| destructive_confirm | bool | true | FLUSHALL, FLUSHDB, pattern deletes, CONFIG SET, SHUTDOWN, CLUSTER FAILOVER and SCRIPT FLUSH are emitted for review instead of run |
Preference areas — customizable dimensions; a stated preference is recorded in config.yaml and applied from then on:
- Tooling — CLI vs RedisInsight vs a provider console, migration tooling (RIOT,
--clusterhelpers), benchmark harness - Thresholds — slowlog threshold worth reporting, big-key size that forces a refactor, fragmentation ratio that triggers a defrag, pipeline batch size,
SCAN COUNT - Conventions — key separator and namespace depth, hash-tag policy, stream and consumer-group naming, cache-key versioning scheme
- Platform — server version, container vs VM, instance memory and cores, network RTT and region, TLS on or off
- Risk posture — run destructive or admin commands directly vs hand back reviewed commands, whether replica reads are acceptable, whether runtime
CONFIG SETis allowed at all - Output format —
redis-clitranscripts vs client-library code, whether Lua is welcome, how much of the reasoning to narrate - Work order — measure-before-change gates, whether to rehearse on a restored copy first, review before any keyspace-wide operation
- Integrations — monitoring stack (
INFOscraping, Prometheus exporter, provider metrics), backup destination, alerting targets - Restrictions — commands disabled by policy or provider (
KEYS,FLUSHALL,DEBUG,EVAL), compliance regimes mandating TLS, ACLs or encryption at rest - Cadence — restore-drill frequency, big-key and TTL audit cycle, failover-drill schedule
Traps
| Trap | Why it fails | Do instead |
|---|---|---|
KEYS pattern in application code | O(N) over the whole keyspace with every other client blocked behind it | SCAN cursor loop, or maintain an index set alongside (→ cli.md) |
INCR then EXPIRE as two calls | A crash between them leaves a counter that never expires — a rate limiter that locks a user out forever | One Lua script, or SET k 0 EX NX before INCR (→ patterns.md) |
DEL on a multi-million-element collection | Frees every element synchronously; a multi-second stall | UNLINK, plus lazyfree-lazy-* on the server |
MULTI/EXEC used as a transaction with rollback | Runtime errors leave earlier commands applied; there is no rollback | Lua for all-or-nothing (→ scripting.md) |
| Storing a JSON blob and updating one field | Read-modify-write over the network loses concurrent updates and re-serializes the whole document | Hash fields, or the JSON module for partial updates (→ modules.md) |
| Pub/Sub for work that must not be lost | At-most-once, no persistence, no acks: a disconnected subscriber misses everything | Streams with a consumer group (→ queues.md) |
XACK without trimming | Acking removes the entry from the pending list, not from the stream; memory grows unbounded | XADD ... MAXLEN ~ N or a periodic XTRIM MINID (→ queues.md) |
Releasing a lock with DEL key | After a TTL expiry you delete the next holder's lock | Lua compare-and-delete on the token (→ locks.md) |
| Expiry events used as a reliable trigger | Keyspace notifications are Pub/Sub: fire-and-forget, and the event fires when the key is actually deleted, not at the TTL instant | A sorted set of due timestamps polled by a worker (→ keys-ttl.md) |
CONFIG SET without CONFIG REWRITE | The change disappears on the next restart, usually during the next incident | Rewrite the config file, or change it in the provider's parameter group |
SELECT 3 for multi-tenancy | Numbered databases share the same memory, eviction and blocking; Cluster only has db 0 | Key prefixes, or separate instances (→ keys-ttl.md) |
| Reading from a replica for correctness | Asynchronous replication returns stale data, and a lagging replica returns very stale data | Read the master, or make staleness explicit in the API (→ high-availability.md) |
MONITOR left running in production | It streams every command to your client and can cut throughput by more than half | SLOWLOG, INFO commandstats, --hotkeys (→ cli.md) |
| Hash tags applied to everything | All keys land in one slot: a cluster with a single hot node and no way to rebalance | Tag only the groups you actually access together (→ cluster.md) |
Where Experts Disagree
- Redis as a primary database. One camp treats any AOF-durable Redis as a legitimate system of record; the other allows only regenerable data. The testable boundary: can you name the recovery path when the last N seconds of writes are lost and no other system has them? If not, Redis is a cache with good uptime, not a database.
- Redlock for distributed locking. Multi-node Redlock adds availability but not correctness: its author and its critics have never agreed on the clock and process-pause assumptions it needs. Practical stance: single-node lock plus a short TTL for mutual exclusion that is an optimization; when correctness depends on the lock, you need fencing tokens checked by the resource itself (→
locks.md). - RDB vs AOF vs both. RDB restores fast and forks rarely; AOF loses less. The disagreement is about the fork cost on large datasets. Boundary: dataset under a few GB and both on is nearly free; tens of GB and the fork pause becomes the argument for RDB-on-a-replica-only.
- Cluster vs a bigger instance. Cluster costs you multi-key operations, transactions across slots, and operational complexity. Most workloads outgrow one node's throughput far later than they think: reach for Cluster when the dataset no longer fits one machine or a single core saturates, not at the first latency complaint.
- Lua in the server vs logic in the app. Scripts buy atomicity and cut round trips; they also block the server and are hard to observe and version. Boundary: short, bounded, key-scoped scripts yes; anything looping over unbounded data, no.
- Redis vs the Valkey fork. After the 2024 license change the ecosystem split; both remain protocol-compatible for the classic command set, and the divergence is in modules, threading and licensing rather than in the fundamentals of this skill (dated detail in
managed-redis.md).
Related Skills
More Clawic skills, get them at https://clawic.com/skills/redis-store (install if the user confirms):
caching— store-agnostic cache strategy: hierarchy, invalidation policy, stampede theoryrate-limiting— picking the algorithm (token bucket, sliding window) before implementing it heredistributed-systems— consistency models and partial failure behind the replication and lock tradeoffspg— when the data wants durability, joins, or transactions rather than a memory storeobservability— turningINFOand latency events into alerts that fire before the incident
Part of Clawic, the verified skill library. Get this skill: https://clawic.com/skills/redis-store.
常见问题
- 是否包含 Valkey 和托管 Redis 服务?
- 包含。迁移章节涉及单机到集群的扩容、版本升级、切到 Valkey 分支,以及 ElastiCache、MemoryDB、Redis Cloud、Upstash、Memorystore、Azure 等托管平台。
- 能帮我选限流算法吗?
- 不能。限流算法的选型被明确标为不涵盖的内容;该技能讲解在 Redis 中如何实现限流器,不讲算法本身的取舍。
- 生产故障时如何使用它?
- 提供了写入 OOM、延迟飙升、服务无响应、键空间被清空、故障转移丢写入、副机不同步等问题的症状到原因排查脚本,以及 INFO、SLOWLOG GET 10、LATENCY DOCTOR、MEMORY DOCTOR 等确认手段,建议在改动前先在 redis-cli 中复现。
相关技能
Upstash Redis (upstash.com). Use this skill for ANY Upstash Redis request — reading, creating, updating, and deleting data. Whenever a task involves Upstash Redis, use this skill instead of calling the API directly.
Predis.ai (predis.ai). Use this skill for ANY Predis.ai request — reading, creating, and updating data. Whenever a task involves Predis.ai, use this skill instead of calling the API directly.
端到端管理 RedisShake 数据迁移任务:从用户提供的 Excel 表格、文本描述或逐项问答中提取迁移信息,生成 shake.toml 配置文件,并在本地或通过 SSH 远程部署、启动、停止、监控迁移任务。当用户需要配置 Redis 迁移/同步、提供了含 Redis 地址密码等信息的文本/表格、需要启动或管理 RedisShake 任务、或通过 SSH 远程操作服务器时触发。本 skill 不适用于:MongoDB/MySQL/ES 等非 Redis 数据迁移、Redis 内存 dump 备份、集群拓扑改造、未提供 SSH 凭证的远程操作;本 skill 不验证迁移后的数据一致性(推荐使用redis-full-check进行校验),仅在已部署 redis-shake 二进制的 Linux 服务器上运行。
Use this skill whenever the user needs to operate a redis cache or a rabbitmq broker — a one-shot overview, redis memory posture (used vs maxmemory, eviction policy, fragmentation), SLOWLOG and a SCAN-budgeted big-key sample (never KEYS *), connected clients, CONFIG get/set, rabbitmq queues with backlog depth, connections/channels, policies and node watermark alarms, four flagship RCAs (redis memory pressure, redis latency/slowlog, rabbitmq queue backlog, connection churn on both platforms), and governed writes (set a config parameter, kill a client, declare/purge/delete a queue, set/delete a policy). Always use this skill for "redis", "rabbitmq", "maxmemory", "eviction", "evicted keys", "big key", "slowlog", "why is my cache slow", "queue backlog", "messages piling up", "no consumers", "unacked messages", "memory watermark", "connection churn", "purge a queue", "rabbitmq policy" when the context is a redis or rabbitmq deployment. Do NOT use when the target is something other than a re
研发IP全栈加速器——面向全行业研发创新型企业,输入企业名称自动驱动六大IP模块(全部内置,用户只需安装本技能): ①诉讼情报预警、②友商情报监控(完整内置tech-intel-monitor逻辑·Eureka Monitor风格)、③FTO产品防侵权、 ④技术方案探索(5改进+4创新+6白点+工程可靠性)、⑤查新检索(8步严谨分析·PatentBench认证X检出率81%)、 ⑥技术交底书(九章标准格式+3实施例+Word自动下载),形成从IP意识唤醒到高质量专利申请的完整闭环。 无需安装其他技能,一包搞定全部功能。
Iván 的更多技能
浏览全部技能为自然搜索排名提供站点审计、内容撰写与竞品分析。
执行 Git 操作(提交、分支、合并、变基、冲突解决与恢复)时强制套用安全规则。
在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。
按配置的 JDK 版本诊断 Java 与 JVM 问题(从 NPE 到容器 OOM),给出可直接套用的代码与配置。
用可量化的层级、间距、字号、配色与版式规则,绘制并诊断视觉作品。
围绕 CSS 机制排查问题并编写组件样式表,而不是凭感觉试错。