Giter VIP home page Giter VIP logo

Comments (6)

weyoss avatar weyoss commented on August 17, 2024 1

For a producer, 1 connection is enough.
For the consumer, 3 connections are enough, one for the main process and two for the forks.

Well, if you are confident enough about your early statements, I highly encourage you to start your own project and propose it to the open source community, to be used in production-ready environments. I mean, go ahead! )

from redis-smq.

weyoss avatar weyoss commented on August 17, 2024 1

The number of connections for both the producer and the consumer is JUSTIFIED.

Let me make it clear.

By design, the RedisMQ is composed of many layers. Because we are talking about high performance (c), the main requirements for the requests to the Redis server of each layer are:

  1. Requests should be executed as fast as possible
  2. Requests from one layer should not block/delay the requests from other layers.

Considering the requirements, the best solution would be if each layer could operate on its own connections to Redis. Of course, new connections to Redis are made only when needed. For managing distributed locks, RedisSMQ uses the redlock package, which also maintains its own Redis connections (see https://www.npmjs.com/package/redlock).

Here is the minimum number of connections needed for a producer :

  1. A connection for publishing messages
  2. A connection for publishing statistical data (stats can be disabled)
  3. A connection for the scheduler
  4. A connection for the lock manager which is used by the scheduler

The number and the purpose of the connections used by a consumer instance can be verified the same way. Consumers are more complex than producers, and include more layers (gc, heartbeat, etc.).

RedisSMQ has been rigorously tested before being used in production at large scale for many projects that I developed. When benchmarking RedisSMQ, the numbers speak for themselves.

from redis-smq.

weyoss avatar weyoss commented on August 17, 2024 1

@intech In anyway, thank you for your feedback

from redis-smq.

intech avatar intech commented on August 17, 2024 1

Why create another product when it is possible to improve existing ones ;)
Thanks for the detailed explanation of the design.
I will do a detailed analysis to confirm or refute my statements about connections and locks in redis (single thread). I will also do a comparative test with keydb (multi-thread redis) and share the results in this issue.

from redis-smq.

weyoss avatar weyoss commented on August 17, 2024

If we are talking about high performance, then a large number of connections create locks at the redis level

Not true. First of all, a large number of connections is not the reason behind database locking issues. It does simply tell you that you have a problem somewhere in your code and that your should handle it, maybe a concurrency issue. In general, when dealing with locking issues (no matter at which level), looking at the number of requests (connections) is useless. Your should investigate the matter of your requests and figure out WHAT they are doing.

By the way, have you found any locks? I would be grateful if you could show me at least one issue in this regard.

from redis-smq.

weyoss avatar weyoss commented on August 17, 2024

You're welcome!

If you find any issue please feel free to report it.

from redis-smq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.