|
After some issue of to many connection on my redis, I saw there is table for connection list, one column for a name. |
Replies: 1 comment 1 reply
|
Use the top-level import { createClient } from 'redis'
const client = createClient({
url: process.env.REDIS_URL,
name: `api:${process.env.HOSTNAME ?? 'local'}`,
})
client.on('error', console.error)
await client.connect()Node Redis sends that value through If the client is already connected, the equivalent command is: await client.clientSetName('api:worker-1')A couple of operational details:
The current client configuration reference lists |

Use the top-level
nameoption when creating the client:Node Redis sends that value through
HELLO ... SETNAME(RESP3) orCLIENT SETNAMEduring connection setup, so it appears in thenamecolumn ofCLIENT LIST.If the client is already connected, the equivalent command is:
A couple of operational details: