You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The node_redis documentation provides that the following arguments may be used to create a Redis client:
redis.createClient([options])
redis.createClient(unix_socket[, options])
redis.createClient(redis_url[, options])
redis.createClient(port[, host][, options])
Tip: If the Redis server runs on the same machine as the client consider using unix sockets if possible to increase throughput.
Currently, the Queue constructor does not appear to provide any way of creating a Redis client using a socket.
One way to implement this might be to check whether the redisConnectionString argument has been provided and is a file path to a unix socket. The default socket path used by Redis is "/tmp/redis.sock".
But I can see there are module-scoped redisHost and redisPort variables in the Queue class, and it's not clear to me exactly how they are used, or whether other parts of the bull package make assumptions about those variables or the nature of the Redis connection. If there are no such assumptions, it may be relatively straightforward to add socket support.
Redis benchmarks show that, depending on the platform, "unix domain sockets can achieve around 50% more throughput than the TCP/IP loopback (on Linux for instance)".
The text was updated successfully, but these errors were encountered:
Makes sense performance wise, but it is still an edge case since normally redis will run in a separate machine or container than the worker process. We can keep it as a potential enhancement since it is not difficult to fix. PR welcome.
You can get around this functionality by passing null into both the port and hostname:
varqueue=Queue('my queue',null,null,redisConfig);
I'd also like to comment that this really isn't something I would consider an edge case scenario. It might not be for your your specific work, but with Docker and network defined storage this is still a very likely setup.
The
node_redis
documentation provides that the following arguments may be used to create a Redis client:Currently, the
Queue
constructor does not appear to provide any way of creating a Redis client using a socket.One way to implement this might be to check whether the
redisConnectionString
argument has been provided and is a file path to a unix socket. The default socket path used by Redis is "/tmp/redis.sock".But I can see there are module-scoped
redisHost
andredisPort
variables in the Queue class, and it's not clear to me exactly how they are used, or whether other parts of the bull package make assumptions about those variables or the nature of the Redis connection. If there are no such assumptions, it may be relatively straightforward to add socket support.Redis benchmarks show that, depending on the platform, "unix domain sockets can achieve around 50% more throughput than the TCP/IP loopback (on Linux for instance)".
The text was updated successfully, but these errors were encountered: