{"id":46136,"library":"redis-mpool","title":"redis-mpool","description":"redis-mpool (v0.8.2) provides connection pool management for Redis databases in Node.js applications. It wraps the node_redis client to create a pool of connections, handling acquisition, release, and automatic reconnection. The library is maintained by CartoDB and has a modest release cadence. It differentiates from generic pooling libraries by being Redis-specific, offering built-in error handling and pool health checks tailored to Redis. Note: This package has not been updated since 2020 and may lack support for newer Redis features like Redis 6 ACLs or TLS connections.","status":"active","version":"0.8.2","language":"javascript","source_language":"en","source_url":"git://github.com/cartodb/node-redis-mpool","tags":["javascript"],"install":[{"cmd":"npm install redis-mpool","lang":"bash","label":"npm"},{"cmd":"yarn add redis-mpool","lang":"bash","label":"yarn"},{"cmd":"pnpm add redis-mpool","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The underlying Redis client used by the pool","package":"redis","optional":false},{"reason":"Provides the generic connection pool implementation","package":"generic-pool","optional":false}],"imports":[{"note":"Default export is the RedisPool constructor. CommonJS users should use const RedisPool = require('redis-mpool').","wrong":"const RedisPool = require('redis-mpool').RedisPool","symbol":"default","correct":"import RedisPool from 'redis-mpool'"},{"note":"Named export does not exist; the module exports a single constructor as default.","wrong":"const { RedisPool } = require('redis-mpool')","symbol":"RedisPool","correct":"import RedisPool from 'redis-mpool'"},{"note":"PoolStatus is a named export for pool status constants. Available from version 0.7.0 onwards.","wrong":"const PoolStatus = require('redis-mpool').PoolStatus","symbol":"PoolStatus","correct":"import { PoolStatus } from 'redis-mpool'"}],"quickstart":{"code":"import RedisPool from 'redis-mpool';\n\nconst pool = new RedisPool({\n  host: process.env.REDIS_HOST || 'localhost',\n  port: parseInt(process.env.REDIS_PORT) || 6379,\n  max: 10,\n  min: 2,\n  idleTimeoutMillis: 30000,\n  reapIntervalMillis: 1000,\n  redisOptions: {\n    auth_pass: process.env.REDIS_PASS || ''\n  }\n});\n\nasync function example() {\n  const client = await pool.acquire();\n  try {\n    const reply = await new Promise((resolve, reject) => {\n      client.get('mykey', (err, res) => {\n        if (err) reject(err);\n        else resolve(res);\n      });\n    });\n    console.log(reply);\n  } finally {\n    pool.release(client);\n  }\n}\n\nexample().catch(console.error);","lang":"typescript","description":"Shows creating a Redis connection pool with custom options, acquiring a client, performing a Redis GET command, and releasing the client back to the pool."},"warnings":[{"fix":"Migrate to ioredis or redis@4 with 'createClient' which includes built-in connection pooling.","message":"package 'redis-mpool' is deprecated. Use 'ioredis' with built-in connection pooling or 'redis' v4 with clustering instead.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use 'max' and 'min' integer properties in pool config.","message":"Pool options changed between versions: 'max' and 'min' replaced 'maxConnections' and 'minConnections'. Update your pool configuration.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Implement a health check or use a library like 'ioredis' that handles reconnection transparently.","message":"The pool does not automatically reconnect after Redis server restart; clients may become stale. You must detect and discard stale clients manually.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass 'password' in redisOptions instead of 'auth_pass'.","message":"The 'auth_pass' option is no longer supported in redis > 3.0. Use 'password' instead.","severity":"breaking","affected_versions":">=0.7.0"}],"env_vars":null,"search_vec":"'2020':80 '6':91 'acl':92 'acquisit':31 'applic':17 'automat':34 'built':61 'built-in':60 'cadenc':47 'cartodb':41 'check':68 'client':23 'connect':9,29,95 'creat':25 'databas':14 'differenti':49 'error':63 'featur':88 'generic':51 'handl':30,64 'health':67 'javascript':96 'lack':83 'librari':37,53 'like':89 'maintain':39 'manag':11 'may':82 'modest':45 'mpool':3,6 'newer':86 'node':21 'node.js':16 'note':72 'offer':59 'packag':74 'pool':10,27,52,66 'provid':8 'reconnect':35 'redi':2,5,13,22,57,71,87,90 'redis-mpool':1,4 'redis-specif':56 'releas':32,46 'sinc':79 'specif':58 'support':84 'tailor':69 'tls':94 'updat':78 'v0.8.2':7 'wrap':19","created_at":"2026-06-07T12:58:27.753582+00:00","updated_at":"2026-06-07T12:58:27.753582+00:00","problems":[{"fix":"Start Redis server with 'redis-server' or check host/port.","cause":"Redis server is not running or unreachable.","error":"Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED"},{"fix":"Upgrade to version 0.6.0+ and use pool.acquire().","cause":"Using an older version of redis-mpool where the method was named 'getConnection'.","error":"TypeError: pool.acquire is not a function"},{"fix":"Increase the 'max' pool option or ensure clients are released after use.","cause":"All connections in the pool are in use and the pool max size is reached.","error":"Error: The pool is full and no resources are available"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/cartodb/node-redis-mpool#readme","github":"git://github.com/cartodb/node-redis-mpool","docs":null,"changelog":null,"pypi":null,"npm":"redis-mpool","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}