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

adamgajzlerowicz picture adamgajzlerowicz  路  4Comments

shmendo picture shmendo  路  6Comments

abhaygarg picture abhaygarg  路  5Comments

dotSlashLu picture dotSlashLu  路  5Comments

gpascale picture gpascale  路  4Comments