Giter Club home page Giter Club logo

Comments (11)

zuiderkwast avatar zuiderkwast commented on September 25, 2024

Do you have an idea about a possible solution, either to this project or to https://github.com/redis/hiredis?

from hiredis-cluster.

bjosv avatar bjosv commented on September 25, 2024

@wangfuqiang responded in you first question in #83

from hiredis-cluster.

zjhua68 avatar zjhua68 commented on September 25, 2024

The command_timeout in redisClusterContext does not copy to redisContext, redisSetTimeout which set the redisContext’ timeout in hircluster.c actully set nothing?
So add a call redisContextUpdateCommandTimeout before redisSetTimeout can fix this?

from hiredis-cluster.

bjosv avatar bjosv commented on September 25, 2024

@zjhua68 Have you seen this issue in the async api case only, or is it a generic problem?

from hiredis-cluster.

zuiderkwast avatar zuiderkwast commented on September 25, 2024

redisSetTimeout sets the socket options directly on the file descriptor using setsockopt (but only if the socket is in blocking mode). When we call redisReconnect, we call redisSetTimeout afterwards explicitly from hircluster so it should work even if the timeout is not stored in redisContext. Only if the socket is nonblocking, I can see a problem here that redisContextSetTimeout is never called. (Maybe there is a different handling for the nonblocking case?)

from hiredis-cluster.

wangfuqiang avatar wangfuqiang commented on September 25, 2024

rojec

hey, what's the diffirence betwwen hiredis-cluster
and hiredis ? now , we are using hiredis-cluster

from hiredis-cluster.

bjosv avatar bjosv commented on September 25, 2024

hiredis-cluster is a client for Redis Cluster, where data is sharded across multiple Redis instances. It uses hiredis under the hood and handles the calculation of which cluster instance to send the query to. hiredis-cluster has a connection to each cluster node, which is provided by hiredis.
If you don't have a Redis cluster running hiredis will do.

from hiredis-cluster.

wangfuqiang avatar wangfuqiang commented on September 25, 2024

hiredis-cluster is a client for Redis Cluster, where data is sharded across multiple Redis instances. It uses hiredis under the hood and handles the calculation of which cluster instance to send the query to. hiredis-cluster has a connection to each cluster node, which is provided by hiredis. If you don't have a Redis cluster running hiredis will do.

hey, our redis are running on cluster mode, Timeout issus is still not resolved, do u have any idea?

from hiredis-cluster.

bjosv avatar bjosv commented on September 25, 2024

See comment in #83

from hiredis-cluster.

bjosv avatar bjosv commented on September 25, 2024

I ran some tests myself in both hiredis and hiredis-cluster and the precision is not perfect.
Since hiredis-cluster rely on hiredis, and hiredis relies on a socket config, i.e the kernel, I'm not sure how we could improve this.
We are not running on a real-time system, so I would guess we couldn't get an exact precision.
I'm open to proposals or ideas how to improve it.

Here is the test results of configured timeout vs measured:

hiredis-cluster 0.8.0
Configured timeout vs result of 500 queries (Linux x86_64 5.4.0-122-generic):

Conf:   Result:
1ms   - Average:    8 ms  Max:   12 ms  Min:    6 ms
5ms   - Average:   12 ms  Max:   16 ms  Min:    8 ms
10ms  - Average:   16 ms  Max:   20 ms  Min:   14 ms
20ms  - Average:   24 ms  Max:   30 ms  Min:   23 ms
50ms  - Average:   56 ms  Max:   60 ms  Min:   52 ms
100ms - Average:  104 ms  Max:  108 ms  Min:  103 ms
500ms - Average:  511 ms  Max:  516 ms  Min:  507 ms
1s    - Average: 1023 ms  Max: 1028 ms  Min: 1009 ms

Running similar tests using hiredis only gives similar results:

hiredis (on commit 06be7ff312a78f69237e5963cc7d24bc84104d3b)
Configured timeout vs result of 500 queries (Linux x86_64 5.4.0-122-generic):

Conf:   Result:
1ms   - Average:    7 ms  Max:   17 ms  Min:    6 ms
5ms   - Average:   11 ms  Max:   16 ms  Min:    8 ms
10ms  - Average:   15 ms  Max:   20 ms  Min:   14 ms
20ms  - Average:   23 ms  Max:   28 ms  Min:   21 ms
50ms  - Average:   55 ms  Max:   60 ms  Min:   54 ms
100ms - Average:  103 ms  Max:  109 ms  Min:  101 ms
500ms - Average:  511 ms  Max:  517 ms  Min:  507 ms
1s    - Average: 1023 ms  Max: 1031 ms  Min: 1014 ms

from hiredis-cluster.

zuiderkwast avatar zuiderkwast commented on September 25, 2024

Duplicate of #83.

from hiredis-cluster.

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.