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

Stono picture Stono  路  6Comments

twappworld picture twappworld  路  7Comments

lemon707 picture lemon707  路  3Comments

juriansluiman picture juriansluiman  路  3Comments

strumwolf picture strumwolf  路  4Comments