Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #346
Closed
Open
Issue created Sep 12, 2016 by Administrator@rootContributor

Connect to Redis using a unix socket

Created by: jamesk-au

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)".

Assignee
Assign to
Time tracking