redis-connections

Configure Redis clients with pooling, pipelining, client-side caching, and timeout tuning.

Updated Jul 25, 2026
One-click install
npx skills add https://github.com/kaannakiin/turborepo_template --skill redis-connections-kaannakiin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: redis-connections
Source: https://github.com/kaannakiin/turborepo_template/tree/main/.agents/skills/redis-connections
Command: npx skills add https://github.com/kaannakiin/turborepo_template --skill redis-connections-kaannakiin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Redis client code often suffers from per-request connection creation, N+1 round trips, blocking commands that stall the server, and poorly tuned timeouts. This Skill provides concrete guidance for configuring Redis clients correctly across redis-py, Jedis, Lettuce, go-redis, and NRedisStack. ## Core Features & Use Cases - Connection Pooling & Multiplexing: Reuse connections via pools (redis-py, Jedis, go-redis) or multiplexing (Lettuce, NRedisStack) instead of opening a new TCP connection per request. - Pipelining & Safe Iteration: Batch independent commands into one round trip and replace KEYS, SMEMBERS, and HGETALL with SCAN, SSCAN, and HSCAN cursor loops. - Client-Side Caching & Timeouts: Enable RESP3 client-side caching for read-heavy hot keys and set explicit connect/read timeouts matched to your failure model. - Use Case: You notice high latency in a Python service making many small Redis calls. Apply this Skill to switch to a shared ConnectionPool, pipeline the bulk GETs, and add socket timeouts to fail fast on dead nodes. ## Quick Start Review my Redis client setup and rewrite it to use connection pooling, pipelining for bulk reads, and explicit socket timeouts.

Frequently Asked Questions about redis-connections

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Redis connection pooling in Python?

Create a redis.ConnectionPool with host, port, and max_connections, then pass it to redis.Redis via the connection_pool parameter. The pool reuses persistent connections across calls instead of opening a new TCP connection per request.

How to batch multiple Redis commands with pipelining?

Create a pipeline object, queue commands on it, then call execute to send them in one round trip. Use non-transactional pipelining for performance and transaction=True only when you need atomicity.

What is the difference between Redis connection pooling and multiplexing?

Pooling keeps multiple persistent connections leased per call, used by redis-py, Jedis, and go-redis. Multiplexing shares a single connection across all requests, used by Lettuce and NRedisStack, but cannot carry blocking commands like BLPOP.

Why should I avoid KEYS and HGETALL in Redis production?

KEYS, SMEMBERS, HGETALL, and full LRANGE scans walk entire datasets and block the single-threaded server. Replace them with incremental cursor-based commands: SCAN, SSCAN, HSCAN, and paginated LRANGE.

When should I enable Redis client-side caching?

Enable RESP3 client-side caching for data read frequently but written rarely, such as config, feature flags, or session data. Skip it for write-heavy workloads since invalidation traffic outweighs the savings.

Can I use blocking commands like BLPOP on a multiplexed connection?

No. Blocking commands like BLPOP, BRPOP, and BLMOVE stall a multiplexed connection (Lettuce, NRedisStack) for all callers. Use them on pooled connections with an explicit timeout, typically for queue consumers.