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

yuany picture yuany  路  4Comments

dotSlashLu picture dotSlashLu  路  5Comments

juriansluiman picture juriansluiman  路  3Comments

Atala picture Atala  路  3Comments

ghost picture ghost  路  3Comments