Node-redis: connecting pool

Created on 17 Jun 2018  路  1Comment  路  Source: NodeRedis/node-redis

Do I need to create and destroy every connect after executing ?

question

Most helpful comment

No!

Pools aren't needed either. Since Node and Redis are both (practically) single-threaded a single connection per Node process is the general pattern. Just use createClient at the top level of your script and move on. Exceptions would be blocking commands (BLPOP, XREAD, etc.) and SUBSCRIBE - those need their own connection.

>All comments

No!

Pools aren't needed either. Since Node and Redis are both (practically) single-threaded a single connection per Node process is the general pattern. Just use createClient at the top level of your script and move on. Exceptions would be blocking commands (BLPOP, XREAD, etc.) and SUBSCRIBE - those need their own connection.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peepo picture peepo  路  19Comments

Janpot picture Janpot  路  21Comments

dmitry-saritasa picture dmitry-saritasa  路  9Comments

xtianus79 picture xtianus79  路  10Comments

MohammedAl-Mahdawi picture MohammedAl-Mahdawi  路  12Comments