[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-redis-redis-connections":3,"mdc-kh608q-key":35,"related-org-redis-redis-connections":828,"related-repo-redis-redis-connections":1015},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":30,"sourceUrl":33,"mdContent":34},"redis-connections","optimize Redis client connections","Redis client and connection guidance covering connection pooling, multiplexing, pipelining, client-side caching with RESP3, avoiding slow commands (KEYS, SMEMBERS, HGETALL), and tuning socket timeouts. Use when configuring a Redis client (redis-py, Jedis, Lettuce, NRedisStack), batching commands for throughput, eliminating per-request connection creation, iterating large keyspaces with SCAN, enabling client-side caching for read-heavy workloads, or setting connect and read timeouts.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"redis","Redis","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fredis.png",[12,16,19,20],{"name":13,"slug":14,"type":15},"Performance","performance","tag",{"name":17,"slug":18,"type":15},"Backend","backend",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"Caching","caching",92,"https:\u002F\u002Fgithub.com\u002Fredis\u002Fagent-skills","2026-05-27T07:19:42.616757","MIT",21,[29,8],"agent-skills",{"repoUrl":24,"stars":23,"forks":27,"topics":31,"description":32},[29,8],"Redis' official collection of agent skills","https:\u002F\u002Fgithub.com\u002Fredis\u002Fagent-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fredis-connections","---\nname: redis-connections\ndescription: Redis client and connection guidance covering connection pooling, multiplexing, pipelining, client-side caching with RESP3, avoiding slow commands (KEYS, SMEMBERS, HGETALL), and tuning socket timeouts. Use when configuring a Redis client (redis-py, Jedis, Lettuce, NRedisStack), batching commands for throughput, eliminating per-request connection creation, iterating large keyspaces with SCAN, enabling client-side caching for read-heavy workloads, or setting connect and read timeouts.\nlicense: MIT\nmetadata:\n  author: Redis, Inc.\n  version: \"0.1.0\"\n---\n\n# Redis Connections\n\nClient-side guidance for talking to Redis efficiently: how to share connections, how to batch commands, which commands not to call in production, when to turn on client-side caching, and how to set timeouts that fail fast without breaking healthy traffic.\n\n## When to apply\n\n- Creating or reviewing a Redis client setup (redis-py, Jedis, Lettuce, go-redis, NRedisStack).\n- Making many small Redis calls and wondering where the latency is going.\n- Iterating large keyspaces, sets, hashes, or lists.\n- Enabling client-side caching for hot keys.\n- Tuning connect \u002F read \u002F write timeouts.\n\n## 1. Pool or multiplex — never one connection per request\n\nThe single biggest mistake in Redis client code is opening a new TCP connection for every operation. Always either:\n\n- **Pool** — keep N persistent connections that the application leases per call (redis-py `ConnectionPool`, Jedis `JedisPooled`, go-redis client).\n- **Multiplex** — share a single connection across all requests (Lettuce, NRedisStack).\n\n| Style | Used by | Note |\n|---|---|---|\n| Pool | redis-py, Jedis, go-redis | Each lease blocks if pool exhausted; size the pool to your concurrency |\n| Multiplex | Lettuce, NRedisStack | Single connection; **cannot** carry blocking commands like `BLPOP` |\n\n```python\n# redis-py — connection pool\npool = redis.ConnectionPool(host=\"localhost\", port=6379, max_connections=50)\nr = redis.Redis(connection_pool=pool)\n```\n\nSee [references\u002Fpooling.md](references\u002Fpooling.md) for Python + Java + Lettuce examples.\n\n## 2. Pipeline bulk work\n\nFor N commands that don't depend on each other's results, send them as a single batch with pipelining. One round-trip instead of N.\n\n```python\npipe = redis.pipeline()\nfor user_id in user_ids:\n    pipe.get(f\"user:{user_id}\")\nresults = pipe.execute()\n```\n\nUse **non-transactional** pipelining for performance, and `pipeline(transaction=True)` only when you actually need atomicity (see redis-core's transactions guidance).\n\nSee [references\u002Fpipelining.md](references\u002Fpipelining.md).\n\n## 3. Avoid commands that scan everything\n\nAnything that walks the whole keyspace (or a whole large container) blocks the server. Use incremental variants instead.\n\n| Don't | Use |\n|---|---|\n| `KEYS pattern` | `SCAN` cursor loop |\n| `SMEMBERS large_set` | `SSCAN` |\n| `HGETALL large_hash` | `HSCAN` |\n| `LRANGE 0 -1` on a huge list | Paginate (`LRANGE 0 100`) |\n\n```python\ncursor = 0\nwhile True:\n    cursor, keys = redis.scan(cursor, match=\"user:*\", count=100)\n    for key in keys:\n        process(key)\n    if cursor == 0:\n        break\n```\n\n**Blocking commands (`BLPOP`, `BRPOP`, `BLMOVE`) are different** — they intentionally wait for data and are fine for queue consumers, but always pass a timeout, and don't issue them on a multiplexed connection (Lettuce, NRedisStack).\n\nSee [references\u002Fblocking.md](references\u002Fblocking.md).\n\n## 4. Client-side caching for hot keys\n\nFor data that's read often and written rarely (config, feature flags, sessions on every request), enable RESP3 client-side caching. The client keeps a local copy and the server invalidates it on writes — saving the round trip for hot reads.\n\n```python\nclient = redis.Redis(\n    host=\"localhost\",\n    port=6379,\n    protocol=3,                                    # RESP3 is required\n    cache_config=redis.CacheConfig(max_size=1000),\n)\n```\n\nSkip it for write-heavy workloads or data that changes constantly — the invalidation traffic overruns the savings.\n\nSee [references\u002Fclient-cache.md](references\u002Fclient-cache.md).\n\n## 5. Set explicit timeouts\n\nDefaults vary by client and may be too generous. Pick values that match the *application's* failure model:\n\n```python\nr = redis.Redis(\n    host=\"localhost\",\n    socket_connect_timeout=2.0,   # fail fast on dead nodes\n    socket_timeout=5.0,           # tune to expected operation time\n    retry_on_timeout=True,\n)\n```\n\nRule of thumb: connect timeout shorter than read\u002Fwrite timeout. Tight timeouts + retry-on-timeout for latency-sensitive paths; longer timeouts for batch jobs.\n\nSee [references\u002Ftimeouts.md](references\u002Ftimeouts.md).\n\n## References\n\n- [Redis: Connection Pools and Multiplexing](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002Fpools-and-muxing\u002F)\n- [Redis: Pipelining](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fuse\u002Fpipelining\u002F)\n- [Redis: SCAN](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fcommands\u002Fscan\u002F)\n- [Redis: Client-side caching](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002Fclient-side-caching\u002F)\n- [Redis: Clients](https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002F)\n",{"data":36,"body":40},{"name":4,"description":6,"license":26,"metadata":37},{"author":38,"version":39},"Redis, Inc.","0.1.0",{"type":41,"children":42},"root",[43,51,57,64,94,100,105,146,226,266,279,285,290,330,350,361,367,372,486,552,584,594,600,605,660,665,675,681,694,747,752,762,768,822],{"type":44,"tag":45,"props":46,"children":47},"element","h1",{"id":4},[48],{"type":49,"value":50},"text","Redis Connections",{"type":44,"tag":52,"props":53,"children":54},"p",{},[55],{"type":49,"value":56},"Client-side guidance for talking to Redis efficiently: how to share connections, how to batch commands, which commands not to call in production, when to turn on client-side caching, and how to set timeouts that fail fast without breaking healthy traffic.",{"type":44,"tag":58,"props":59,"children":61},"h2",{"id":60},"when-to-apply",[62],{"type":49,"value":63},"When to apply",{"type":44,"tag":65,"props":66,"children":67},"ul",{},[68,74,79,84,89],{"type":44,"tag":69,"props":70,"children":71},"li",{},[72],{"type":49,"value":73},"Creating or reviewing a Redis client setup (redis-py, Jedis, Lettuce, go-redis, NRedisStack).",{"type":44,"tag":69,"props":75,"children":76},{},[77],{"type":49,"value":78},"Making many small Redis calls and wondering where the latency is going.",{"type":44,"tag":69,"props":80,"children":81},{},[82],{"type":49,"value":83},"Iterating large keyspaces, sets, hashes, or lists.",{"type":44,"tag":69,"props":85,"children":86},{},[87],{"type":49,"value":88},"Enabling client-side caching for hot keys.",{"type":44,"tag":69,"props":90,"children":91},{},[92],{"type":49,"value":93},"Tuning connect \u002F read \u002F write timeouts.",{"type":44,"tag":58,"props":95,"children":97},{"id":96},"_1-pool-or-multiplex-never-one-connection-per-request",[98],{"type":49,"value":99},"1. Pool or multiplex — never one connection per request",{"type":44,"tag":52,"props":101,"children":102},{},[103],{"type":49,"value":104},"The single biggest mistake in Redis client code is opening a new TCP connection for every operation. Always either:",{"type":44,"tag":65,"props":106,"children":107},{},[108,136],{"type":44,"tag":69,"props":109,"children":110},{},[111,117,119,126,128,134],{"type":44,"tag":112,"props":113,"children":114},"strong",{},[115],{"type":49,"value":116},"Pool",{"type":49,"value":118}," — keep N persistent connections that the application leases per call (redis-py ",{"type":44,"tag":120,"props":121,"children":123},"code",{"className":122},[],[124],{"type":49,"value":125},"ConnectionPool",{"type":49,"value":127},", Jedis ",{"type":44,"tag":120,"props":129,"children":131},{"className":130},[],[132],{"type":49,"value":133},"JedisPooled",{"type":49,"value":135},", go-redis client).",{"type":44,"tag":69,"props":137,"children":138},{},[139,144],{"type":44,"tag":112,"props":140,"children":141},{},[142],{"type":49,"value":143},"Multiplex",{"type":49,"value":145}," — share a single connection across all requests (Lettuce, NRedisStack).",{"type":44,"tag":147,"props":148,"children":149},"table",{},[150,174],{"type":44,"tag":151,"props":152,"children":153},"thead",{},[154],{"type":44,"tag":155,"props":156,"children":157},"tr",{},[158,164,169],{"type":44,"tag":159,"props":160,"children":161},"th",{},[162],{"type":49,"value":163},"Style",{"type":44,"tag":159,"props":165,"children":166},{},[167],{"type":49,"value":168},"Used by",{"type":44,"tag":159,"props":170,"children":171},{},[172],{"type":49,"value":173},"Note",{"type":44,"tag":175,"props":176,"children":177},"tbody",{},[178,196],{"type":44,"tag":155,"props":179,"children":180},{},[181,186,191],{"type":44,"tag":182,"props":183,"children":184},"td",{},[185],{"type":49,"value":116},{"type":44,"tag":182,"props":187,"children":188},{},[189],{"type":49,"value":190},"redis-py, Jedis, go-redis",{"type":44,"tag":182,"props":192,"children":193},{},[194],{"type":49,"value":195},"Each lease blocks if pool exhausted; size the pool to your concurrency",{"type":44,"tag":155,"props":197,"children":198},{},[199,203,208],{"type":44,"tag":182,"props":200,"children":201},{},[202],{"type":49,"value":143},{"type":44,"tag":182,"props":204,"children":205},{},[206],{"type":49,"value":207},"Lettuce, NRedisStack",{"type":44,"tag":182,"props":209,"children":210},{},[211,213,218,220],{"type":49,"value":212},"Single connection; ",{"type":44,"tag":112,"props":214,"children":215},{},[216],{"type":49,"value":217},"cannot",{"type":49,"value":219}," carry blocking commands like ",{"type":44,"tag":120,"props":221,"children":223},{"className":222},[],[224],{"type":49,"value":225},"BLPOP",{"type":44,"tag":227,"props":228,"children":233},"pre",{"className":229,"code":230,"language":231,"meta":232,"style":232},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# redis-py — connection pool\npool = redis.ConnectionPool(host=\"localhost\", port=6379, max_connections=50)\nr = redis.Redis(connection_pool=pool)\n","python","",[234],{"type":44,"tag":120,"props":235,"children":236},{"__ignoreMap":232},[237,248,257],{"type":44,"tag":238,"props":239,"children":242},"span",{"class":240,"line":241},"line",1,[243],{"type":44,"tag":238,"props":244,"children":245},{},[246],{"type":49,"value":247},"# redis-py — connection pool\n",{"type":44,"tag":238,"props":249,"children":251},{"class":240,"line":250},2,[252],{"type":44,"tag":238,"props":253,"children":254},{},[255],{"type":49,"value":256},"pool = redis.ConnectionPool(host=\"localhost\", port=6379, max_connections=50)\n",{"type":44,"tag":238,"props":258,"children":260},{"class":240,"line":259},3,[261],{"type":44,"tag":238,"props":262,"children":263},{},[264],{"type":49,"value":265},"r = redis.Redis(connection_pool=pool)\n",{"type":44,"tag":52,"props":267,"children":268},{},[269,271,277],{"type":49,"value":270},"See ",{"type":44,"tag":272,"props":273,"children":275},"a",{"href":274},"references\u002Fpooling.md",[276],{"type":49,"value":274},{"type":49,"value":278}," for Python + Java + Lettuce examples.",{"type":44,"tag":58,"props":280,"children":282},{"id":281},"_2-pipeline-bulk-work",[283],{"type":49,"value":284},"2. Pipeline bulk work",{"type":44,"tag":52,"props":286,"children":287},{},[288],{"type":49,"value":289},"For N commands that don't depend on each other's results, send them as a single batch with pipelining. One round-trip instead of N.",{"type":44,"tag":227,"props":291,"children":293},{"className":229,"code":292,"language":231,"meta":232,"style":232},"pipe = redis.pipeline()\nfor user_id in user_ids:\n    pipe.get(f\"user:{user_id}\")\nresults = pipe.execute()\n",[294],{"type":44,"tag":120,"props":295,"children":296},{"__ignoreMap":232},[297,305,313,321],{"type":44,"tag":238,"props":298,"children":299},{"class":240,"line":241},[300],{"type":44,"tag":238,"props":301,"children":302},{},[303],{"type":49,"value":304},"pipe = redis.pipeline()\n",{"type":44,"tag":238,"props":306,"children":307},{"class":240,"line":250},[308],{"type":44,"tag":238,"props":309,"children":310},{},[311],{"type":49,"value":312},"for user_id in user_ids:\n",{"type":44,"tag":238,"props":314,"children":315},{"class":240,"line":259},[316],{"type":44,"tag":238,"props":317,"children":318},{},[319],{"type":49,"value":320},"    pipe.get(f\"user:{user_id}\")\n",{"type":44,"tag":238,"props":322,"children":324},{"class":240,"line":323},4,[325],{"type":44,"tag":238,"props":326,"children":327},{},[328],{"type":49,"value":329},"results = pipe.execute()\n",{"type":44,"tag":52,"props":331,"children":332},{},[333,335,340,342,348],{"type":49,"value":334},"Use ",{"type":44,"tag":112,"props":336,"children":337},{},[338],{"type":49,"value":339},"non-transactional",{"type":49,"value":341}," pipelining for performance, and ",{"type":44,"tag":120,"props":343,"children":345},{"className":344},[],[346],{"type":49,"value":347},"pipeline(transaction=True)",{"type":49,"value":349}," only when you actually need atomicity (see redis-core's transactions guidance).",{"type":44,"tag":52,"props":351,"children":352},{},[353,354,359],{"type":49,"value":270},{"type":44,"tag":272,"props":355,"children":357},{"href":356},"references\u002Fpipelining.md",[358],{"type":49,"value":356},{"type":49,"value":360},".",{"type":44,"tag":58,"props":362,"children":364},{"id":363},"_3-avoid-commands-that-scan-everything",[365],{"type":49,"value":366},"3. Avoid commands that scan everything",{"type":44,"tag":52,"props":368,"children":369},{},[370],{"type":49,"value":371},"Anything that walks the whole keyspace (or a whole large container) blocks the server. Use incremental variants instead.",{"type":44,"tag":147,"props":373,"children":374},{},[375,391],{"type":44,"tag":151,"props":376,"children":377},{},[378],{"type":44,"tag":155,"props":379,"children":380},{},[381,386],{"type":44,"tag":159,"props":382,"children":383},{},[384],{"type":49,"value":385},"Don't",{"type":44,"tag":159,"props":387,"children":388},{},[389],{"type":49,"value":390},"Use",{"type":44,"tag":175,"props":392,"children":393},{},[394,417,438,459],{"type":44,"tag":155,"props":395,"children":396},{},[397,406],{"type":44,"tag":182,"props":398,"children":399},{},[400],{"type":44,"tag":120,"props":401,"children":403},{"className":402},[],[404],{"type":49,"value":405},"KEYS pattern",{"type":44,"tag":182,"props":407,"children":408},{},[409,415],{"type":44,"tag":120,"props":410,"children":412},{"className":411},[],[413],{"type":49,"value":414},"SCAN",{"type":49,"value":416}," cursor loop",{"type":44,"tag":155,"props":418,"children":419},{},[420,429],{"type":44,"tag":182,"props":421,"children":422},{},[423],{"type":44,"tag":120,"props":424,"children":426},{"className":425},[],[427],{"type":49,"value":428},"SMEMBERS large_set",{"type":44,"tag":182,"props":430,"children":431},{},[432],{"type":44,"tag":120,"props":433,"children":435},{"className":434},[],[436],{"type":49,"value":437},"SSCAN",{"type":44,"tag":155,"props":439,"children":440},{},[441,450],{"type":44,"tag":182,"props":442,"children":443},{},[444],{"type":44,"tag":120,"props":445,"children":447},{"className":446},[],[448],{"type":49,"value":449},"HGETALL large_hash",{"type":44,"tag":182,"props":451,"children":452},{},[453],{"type":44,"tag":120,"props":454,"children":456},{"className":455},[],[457],{"type":49,"value":458},"HSCAN",{"type":44,"tag":155,"props":460,"children":461},{},[462,473],{"type":44,"tag":182,"props":463,"children":464},{},[465,471],{"type":44,"tag":120,"props":466,"children":468},{"className":467},[],[469],{"type":49,"value":470},"LRANGE 0 -1",{"type":49,"value":472}," on a huge list",{"type":44,"tag":182,"props":474,"children":475},{},[476,478,484],{"type":49,"value":477},"Paginate (",{"type":44,"tag":120,"props":479,"children":481},{"className":480},[],[482],{"type":49,"value":483},"LRANGE 0 100",{"type":49,"value":485},")",{"type":44,"tag":227,"props":487,"children":489},{"className":229,"code":488,"language":231,"meta":232,"style":232},"cursor = 0\nwhile True:\n    cursor, keys = redis.scan(cursor, match=\"user:*\", count=100)\n    for key in keys:\n        process(key)\n    if cursor == 0:\n        break\n",[490],{"type":44,"tag":120,"props":491,"children":492},{"__ignoreMap":232},[493,501,509,517,525,534,543],{"type":44,"tag":238,"props":494,"children":495},{"class":240,"line":241},[496],{"type":44,"tag":238,"props":497,"children":498},{},[499],{"type":49,"value":500},"cursor = 0\n",{"type":44,"tag":238,"props":502,"children":503},{"class":240,"line":250},[504],{"type":44,"tag":238,"props":505,"children":506},{},[507],{"type":49,"value":508},"while True:\n",{"type":44,"tag":238,"props":510,"children":511},{"class":240,"line":259},[512],{"type":44,"tag":238,"props":513,"children":514},{},[515],{"type":49,"value":516},"    cursor, keys = redis.scan(cursor, match=\"user:*\", count=100)\n",{"type":44,"tag":238,"props":518,"children":519},{"class":240,"line":323},[520],{"type":44,"tag":238,"props":521,"children":522},{},[523],{"type":49,"value":524},"    for key in keys:\n",{"type":44,"tag":238,"props":526,"children":528},{"class":240,"line":527},5,[529],{"type":44,"tag":238,"props":530,"children":531},{},[532],{"type":49,"value":533},"        process(key)\n",{"type":44,"tag":238,"props":535,"children":537},{"class":240,"line":536},6,[538],{"type":44,"tag":238,"props":539,"children":540},{},[541],{"type":49,"value":542},"    if cursor == 0:\n",{"type":44,"tag":238,"props":544,"children":546},{"class":240,"line":545},7,[547],{"type":44,"tag":238,"props":548,"children":549},{},[550],{"type":49,"value":551},"        break\n",{"type":44,"tag":52,"props":553,"children":554},{},[555,582],{"type":44,"tag":112,"props":556,"children":557},{},[558,560,565,567,573,574,580],{"type":49,"value":559},"Blocking commands (",{"type":44,"tag":120,"props":561,"children":563},{"className":562},[],[564],{"type":49,"value":225},{"type":49,"value":566},", ",{"type":44,"tag":120,"props":568,"children":570},{"className":569},[],[571],{"type":49,"value":572},"BRPOP",{"type":49,"value":566},{"type":44,"tag":120,"props":575,"children":577},{"className":576},[],[578],{"type":49,"value":579},"BLMOVE",{"type":49,"value":581},") are different",{"type":49,"value":583}," — they intentionally wait for data and are fine for queue consumers, but always pass a timeout, and don't issue them on a multiplexed connection (Lettuce, NRedisStack).",{"type":44,"tag":52,"props":585,"children":586},{},[587,588,593],{"type":49,"value":270},{"type":44,"tag":272,"props":589,"children":591},{"href":590},"references\u002Fblocking.md",[592],{"type":49,"value":590},{"type":49,"value":360},{"type":44,"tag":58,"props":595,"children":597},{"id":596},"_4-client-side-caching-for-hot-keys",[598],{"type":49,"value":599},"4. Client-side caching for hot keys",{"type":44,"tag":52,"props":601,"children":602},{},[603],{"type":49,"value":604},"For data that's read often and written rarely (config, feature flags, sessions on every request), enable RESP3 client-side caching. The client keeps a local copy and the server invalidates it on writes — saving the round trip for hot reads.",{"type":44,"tag":227,"props":606,"children":608},{"className":229,"code":607,"language":231,"meta":232,"style":232},"client = redis.Redis(\n    host=\"localhost\",\n    port=6379,\n    protocol=3,                                    # RESP3 is required\n    cache_config=redis.CacheConfig(max_size=1000),\n)\n",[609],{"type":44,"tag":120,"props":610,"children":611},{"__ignoreMap":232},[612,620,628,636,644,652],{"type":44,"tag":238,"props":613,"children":614},{"class":240,"line":241},[615],{"type":44,"tag":238,"props":616,"children":617},{},[618],{"type":49,"value":619},"client = redis.Redis(\n",{"type":44,"tag":238,"props":621,"children":622},{"class":240,"line":250},[623],{"type":44,"tag":238,"props":624,"children":625},{},[626],{"type":49,"value":627},"    host=\"localhost\",\n",{"type":44,"tag":238,"props":629,"children":630},{"class":240,"line":259},[631],{"type":44,"tag":238,"props":632,"children":633},{},[634],{"type":49,"value":635},"    port=6379,\n",{"type":44,"tag":238,"props":637,"children":638},{"class":240,"line":323},[639],{"type":44,"tag":238,"props":640,"children":641},{},[642],{"type":49,"value":643},"    protocol=3,                                    # RESP3 is required\n",{"type":44,"tag":238,"props":645,"children":646},{"class":240,"line":527},[647],{"type":44,"tag":238,"props":648,"children":649},{},[650],{"type":49,"value":651},"    cache_config=redis.CacheConfig(max_size=1000),\n",{"type":44,"tag":238,"props":653,"children":654},{"class":240,"line":536},[655],{"type":44,"tag":238,"props":656,"children":657},{},[658],{"type":49,"value":659},")\n",{"type":44,"tag":52,"props":661,"children":662},{},[663],{"type":49,"value":664},"Skip it for write-heavy workloads or data that changes constantly — the invalidation traffic overruns the savings.",{"type":44,"tag":52,"props":666,"children":667},{},[668,669,674],{"type":49,"value":270},{"type":44,"tag":272,"props":670,"children":672},{"href":671},"references\u002Fclient-cache.md",[673],{"type":49,"value":671},{"type":49,"value":360},{"type":44,"tag":58,"props":676,"children":678},{"id":677},"_5-set-explicit-timeouts",[679],{"type":49,"value":680},"5. Set explicit timeouts",{"type":44,"tag":52,"props":682,"children":683},{},[684,686,692],{"type":49,"value":685},"Defaults vary by client and may be too generous. Pick values that match the ",{"type":44,"tag":687,"props":688,"children":689},"em",{},[690],{"type":49,"value":691},"application's",{"type":49,"value":693}," failure model:",{"type":44,"tag":227,"props":695,"children":697},{"className":229,"code":696,"language":231,"meta":232,"style":232},"r = redis.Redis(\n    host=\"localhost\",\n    socket_connect_timeout=2.0,   # fail fast on dead nodes\n    socket_timeout=5.0,           # tune to expected operation time\n    retry_on_timeout=True,\n)\n",[698],{"type":44,"tag":120,"props":699,"children":700},{"__ignoreMap":232},[701,709,716,724,732,740],{"type":44,"tag":238,"props":702,"children":703},{"class":240,"line":241},[704],{"type":44,"tag":238,"props":705,"children":706},{},[707],{"type":49,"value":708},"r = redis.Redis(\n",{"type":44,"tag":238,"props":710,"children":711},{"class":240,"line":250},[712],{"type":44,"tag":238,"props":713,"children":714},{},[715],{"type":49,"value":627},{"type":44,"tag":238,"props":717,"children":718},{"class":240,"line":259},[719],{"type":44,"tag":238,"props":720,"children":721},{},[722],{"type":49,"value":723},"    socket_connect_timeout=2.0,   # fail fast on dead nodes\n",{"type":44,"tag":238,"props":725,"children":726},{"class":240,"line":323},[727],{"type":44,"tag":238,"props":728,"children":729},{},[730],{"type":49,"value":731},"    socket_timeout=5.0,           # tune to expected operation time\n",{"type":44,"tag":238,"props":733,"children":734},{"class":240,"line":527},[735],{"type":44,"tag":238,"props":736,"children":737},{},[738],{"type":49,"value":739},"    retry_on_timeout=True,\n",{"type":44,"tag":238,"props":741,"children":742},{"class":240,"line":536},[743],{"type":44,"tag":238,"props":744,"children":745},{},[746],{"type":49,"value":659},{"type":44,"tag":52,"props":748,"children":749},{},[750],{"type":49,"value":751},"Rule of thumb: connect timeout shorter than read\u002Fwrite timeout. Tight timeouts + retry-on-timeout for latency-sensitive paths; longer timeouts for batch jobs.",{"type":44,"tag":52,"props":753,"children":754},{},[755,756,761],{"type":49,"value":270},{"type":44,"tag":272,"props":757,"children":759},{"href":758},"references\u002Ftimeouts.md",[760],{"type":49,"value":758},{"type":49,"value":360},{"type":44,"tag":58,"props":763,"children":765},{"id":764},"references",[766],{"type":49,"value":767},"References",{"type":44,"tag":65,"props":769,"children":770},{},[771,782,792,802,812],{"type":44,"tag":69,"props":772,"children":773},{},[774],{"type":44,"tag":272,"props":775,"children":779},{"href":776,"rel":777},"https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002Fpools-and-muxing\u002F",[778],"nofollow",[780],{"type":49,"value":781},"Redis: Connection Pools and Multiplexing",{"type":44,"tag":69,"props":783,"children":784},{},[785],{"type":44,"tag":272,"props":786,"children":789},{"href":787,"rel":788},"https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fuse\u002Fpipelining\u002F",[778],[790],{"type":49,"value":791},"Redis: Pipelining",{"type":44,"tag":69,"props":793,"children":794},{},[795],{"type":44,"tag":272,"props":796,"children":799},{"href":797,"rel":798},"https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fcommands\u002Fscan\u002F",[778],[800],{"type":49,"value":801},"Redis: SCAN",{"type":44,"tag":69,"props":803,"children":804},{},[805],{"type":44,"tag":272,"props":806,"children":809},{"href":807,"rel":808},"https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002Fclient-side-caching\u002F",[778],[810],{"type":49,"value":811},"Redis: Client-side caching",{"type":44,"tag":69,"props":813,"children":814},{},[815],{"type":44,"tag":272,"props":816,"children":819},{"href":817,"rel":818},"https:\u002F\u002Fredis.io\u002Fdocs\u002Flatest\u002Fdevelop\u002Fclients\u002F",[778],[820],{"type":49,"value":821},"Redis: Clients",{"type":44,"tag":823,"props":824,"children":825},"style",{},[826],{"type":49,"value":827},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":829,"total":1014},[830,848,866,873,886,904,920,940,954,969,984,1001],{"slug":831,"name":831,"fn":832,"description":833,"org":834,"tags":835,"stars":23,"repoUrl":24,"updatedAt":847},"iris-development","integrate with Redis Iris AI products","Iris is Redis's umbrella for AI-focused products. Use this skill when integrating with the Iris Redis Agent Memory (RAM) data plane on Redis Cloud — recording session events for an AI agent, creating or searching long-term memories, configuring a memory store, or tuning background memory promotion. Code examples use the official `redis-agent-memory` (Python) and `@redis-iris\u002Fagent-memory` (TypeScript) SDKs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[836,839,842,843,846],{"name":837,"slug":838,"type":15},"Agents","agents",{"name":840,"slug":841,"type":15},"AI Infrastructure","ai-infrastructure",{"name":17,"slug":18,"type":15},{"name":844,"slug":845,"type":15},"Memory","memory",{"name":9,"slug":8,"type":15},"2026-05-27T07:19:45.213725",{"slug":849,"name":849,"fn":850,"description":851,"org":852,"tags":853,"stars":23,"repoUrl":24,"updatedAt":865},"redis-clustering","configure Redis clustering and replication","Redis Cluster and replication guidance covering hash tags for multi-key operations, avoiding CROSSSLOT errors, and reading from replicas to scale read-heavy workloads. Use when designing keys for a sharded Redis Cluster, debugging CROSSSLOT errors on MGET \u002F SDIFF \u002F pipelines, configuring a multi-key transaction in a cluster, or routing reads to replicas for caches, analytics, or dashboards.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[854,857,860,863,864],{"name":855,"slug":856,"type":15},"Architecture","architecture",{"name":858,"slug":859,"type":15},"Database","database",{"name":861,"slug":862,"type":15},"Infrastructure","infrastructure",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-05-27T07:19:38.757599",{"slug":4,"name":4,"fn":5,"description":6,"org":867,"tags":868,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[869,870,871,872],{"name":17,"slug":18,"type":15},{"name":21,"slug":22,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":874,"name":874,"fn":875,"description":876,"org":877,"tags":878,"stars":23,"repoUrl":24,"updatedAt":885},"redis-core","model data with Redis structures","Core Redis modeling guidance — choose the right data structure (String, Hash, List, Set, Sorted Set, JSON, Stream, Vector Set) and use consistent colon-separated key names. Use when designing a Redis data model, caching objects, deciding between Hash and JSON, building counters, leaderboards, membership sets, or session stores, or when reviewing\u002Fcleaning up Redis key naming.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[879,880,883,884],{"name":855,"slug":856,"type":15},{"name":881,"slug":882,"type":15},"Data Modeling","data-modeling",{"name":858,"slug":859,"type":15},{"name":9,"slug":8,"type":15},"2026-05-27T07:19:41.317954",{"slug":887,"name":887,"fn":888,"description":889,"org":890,"tags":891,"stars":23,"repoUrl":24,"updatedAt":903},"redis-observability","monitor and triage Redis performance","Redis observability guidance — which metrics to monitor (memory, connections, hit ratio, ops\u002Fsec, rejected connections), which built-in commands to reach for during incident triage (SLOWLOG, INFO, MEMORY DOCTOR, CLIENT LIST, FT.PROFILE), and when to use the Redis Insight GUI. Use when setting up monitoring or alerts for a Redis instance, diagnosing a performance regression, profiling a slow FT.SEARCH query, or wiring Redis metrics into Prometheus, Datadog, or similar.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[892,895,898,901,902],{"name":893,"slug":894,"type":15},"Debugging","debugging",{"name":896,"slug":897,"type":15},"Monitoring","monitoring",{"name":899,"slug":900,"type":15},"Observability","observability",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-05-27T07:19:47.780873",{"slug":905,"name":905,"fn":906,"description":907,"org":908,"tags":909,"stars":23,"repoUrl":24,"updatedAt":919},"redis-search","implement Redis Search indexing and queries","Redis Search guidance covering FT.CREATE schema design, field type selection (TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR, JSON path), DIALECT 2 query syntax, FT.SEARCH \u002F FT.AGGREGATE \u002F FT.HYBRID command selection, vector similarity with HNSW or FLAT, hybrid retrieval combining lexical and vector ranking, RAG pipelines, zero-downtime index updates via aliases, and debugging with FT.PROFILE and FT.EXPLAIN. Use when defining a search index on Hash or JSON documents, writing FT.SEARCH queries with filters, sorting, aggregation, or vector KNN, tuning HNSW parameters, building a RAG retrieval pipeline, or troubleshooting slow or empty search results.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[910,911,912,915,916],{"name":855,"slug":856,"type":15},{"name":858,"slug":859,"type":15},{"name":913,"slug":914,"type":15},"Engineering","engineering",{"name":9,"slug":8,"type":15},{"name":917,"slug":918,"type":15},"Search","search","2026-06-24T07:39:43.089819",{"slug":921,"name":921,"fn":922,"description":923,"org":924,"tags":925,"stars":23,"repoUrl":24,"updatedAt":939},"redis-security","secure Redis instances and clusters","Redis security guidance covering authentication (requirepass and ACL users), TLS, ACL-based least-privilege access control, restricting network exposure via bind and protected-mode, firewall rules, and disabling dangerous commands. Use when deploying Redis to production, defining ACL users for an application, configuring TLS connections, locking down a Redis instance behind a firewall, or auditing a Redis deployment for security hardening.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[926,929,932,935,936],{"name":927,"slug":928,"type":15},"Access Control","access-control",{"name":930,"slug":931,"type":15},"Authentication","authentication",{"name":933,"slug":934,"type":15},"Compliance","compliance",{"name":9,"slug":8,"type":15},{"name":937,"slug":938,"type":15},"Security","security","2026-05-27T07:19:40.030241",{"slug":941,"name":941,"fn":942,"description":943,"org":944,"tags":945,"stars":23,"repoUrl":24,"updatedAt":953},"redis-semantic-cache","implement semantic caching with Redis","Redis LangCache guidance for semantic caching of LLM responses on Redis Cloud — calling search\u002Fset via the SDK or REST API, tuning the similarity threshold, separating caches per task type, and filtering with custom attributes. Use when caching LLM completions or RAG answers to cut API cost and latency, building a cache-aside layer in front of OpenAI \u002F Anthropic \u002F etc., tuning hit rate vs precision, or splitting one app's LLM workloads into multiple LangCache caches.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[946,947,948,951,952],{"name":840,"slug":841,"type":15},{"name":21,"slug":22,"type":15},{"name":949,"slug":950,"type":15},"LLM","llm",{"name":9,"slug":8,"type":15},{"name":917,"slug":918,"type":15},"2026-05-27T07:19:43.897283",{"slug":955,"name":955,"fn":956,"description":957,"org":958,"tags":959,"stars":966,"repoUrl":967,"updatedAt":968},"agent-filesystem","manage persistent storage in Redis","Use when agents need persistent shared storage, when saving or restoring workspace state, or when coordinating file access across multiple agents and machines. Creates Redis-backed workspaces, checkpoints and restores agent state, mounts shared filesystems locally, searches workspace contents, and forks workspaces for parallel work.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[960,961,964,965],{"name":837,"slug":838,"type":15},{"name":962,"slug":963,"type":15},"File Storage","file-storage",{"name":844,"slug":845,"type":15},{"name":9,"slug":8,"type":15},22,"https:\u002F\u002Fgithub.com\u002Fredis\u002Fagent-filesystem","2026-04-10T04:51:05.904489",{"slug":970,"name":970,"fn":971,"description":972,"org":973,"tags":974,"stars":966,"repoUrl":967,"updatedAt":983},"codex-settings-sync","sync Codex settings across computers","Use when the user wants to migrate Codex state in ~\u002F.codex into Agent Filesystem and mount the same shared Codex memory\u002Fsettings across multiple computers. Recommends a .afsignore before migration and defaults to excluding worktrees, caches, logs, and temporary files.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[975,978,979,982],{"name":976,"slug":977,"type":15},"Codex","codex",{"name":844,"slug":845,"type":15},{"name":980,"slug":981,"type":15},"Migration","migration",{"name":9,"slug":8,"type":15},"2026-04-10T04:51:07.268248",{"slug":985,"name":985,"fn":986,"description":987,"org":988,"tags":989,"stars":998,"repoUrl":999,"updatedAt":1000},"cloud-database-provisioning","provision Redis Cloud databases","Provision a Redis Cloud database end-to-end — Essentials (fixed plan) or Pro (custom) — using Redis Cloud MCP tools",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[990,993,994,997],{"name":991,"slug":992,"type":15},"Cloud","cloud",{"name":858,"slug":859,"type":15},{"name":995,"slug":996,"type":15},"MCP","mcp",{"name":9,"slug":8,"type":15},15,"https:\u002F\u002Fgithub.com\u002Fredis\u002Fredisctl","2026-06-03T07:53:00.906753",{"slug":1002,"name":1002,"fn":1003,"description":1004,"org":1005,"tags":1006,"stars":998,"repoUrl":999,"updatedAt":1013},"compare-approaches","prototype Redis data model alternatives","Prototype and compare 2-3 Redis data model alternatives for the same workload",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1007,1008,1009,1012],{"name":881,"slug":882,"type":15},{"name":858,"slug":859,"type":15},{"name":1010,"slug":1011,"type":15},"Prototyping","prototyping",{"name":9,"slug":8,"type":15},"2026-05-27T07:19:55.591944",27,{"items":1016,"total":1071},[1017,1025,1033,1040,1047,1055,1063],{"slug":831,"name":831,"fn":832,"description":833,"org":1018,"tags":1019,"stars":23,"repoUrl":24,"updatedAt":847},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1020,1021,1022,1023,1024],{"name":837,"slug":838,"type":15},{"name":840,"slug":841,"type":15},{"name":17,"slug":18,"type":15},{"name":844,"slug":845,"type":15},{"name":9,"slug":8,"type":15},{"slug":849,"name":849,"fn":850,"description":851,"org":1026,"tags":1027,"stars":23,"repoUrl":24,"updatedAt":865},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1028,1029,1030,1031,1032],{"name":855,"slug":856,"type":15},{"name":858,"slug":859,"type":15},{"name":861,"slug":862,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":1034,"tags":1035,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1036,1037,1038,1039],{"name":17,"slug":18,"type":15},{"name":21,"slug":22,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":874,"name":874,"fn":875,"description":876,"org":1041,"tags":1042,"stars":23,"repoUrl":24,"updatedAt":885},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1043,1044,1045,1046],{"name":855,"slug":856,"type":15},{"name":881,"slug":882,"type":15},{"name":858,"slug":859,"type":15},{"name":9,"slug":8,"type":15},{"slug":887,"name":887,"fn":888,"description":889,"org":1048,"tags":1049,"stars":23,"repoUrl":24,"updatedAt":903},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1050,1051,1052,1053,1054],{"name":893,"slug":894,"type":15},{"name":896,"slug":897,"type":15},{"name":899,"slug":900,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":905,"name":905,"fn":906,"description":907,"org":1056,"tags":1057,"stars":23,"repoUrl":24,"updatedAt":919},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1058,1059,1060,1061,1062],{"name":855,"slug":856,"type":15},{"name":858,"slug":859,"type":15},{"name":913,"slug":914,"type":15},{"name":9,"slug":8,"type":15},{"name":917,"slug":918,"type":15},{"slug":921,"name":921,"fn":922,"description":923,"org":1064,"tags":1065,"stars":23,"repoUrl":24,"updatedAt":939},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1066,1067,1068,1069,1070],{"name":927,"slug":928,"type":15},{"name":930,"slug":931,"type":15},{"name":933,"slug":934,"type":15},{"name":9,"slug":8,"type":15},{"name":937,"slug":938,"type":15},8]