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

id0Sch picture id0Sch  路  4Comments

yuany picture yuany  路  4Comments

Stono picture Stono  路  6Comments

dotSlashLu picture dotSlashLu  路  5Comments

Atala picture Atala  路  3Comments