Giter Site home page Giter Site logo

jodis问题 about jodis HOT 12 CLOSED

codislabs avatar codislabs commented on August 23, 2024
jodis问题

from jodis.

Comments (12)

yangzhe1991 avatar yangzhe1991 commented on August 23, 2024

刚kill的时候当时还在进行的请求是肯定会断的,但是过了一段时间,最长不超过proxy配置的session超时时间,再请求就不会报错了

2015年12月15日星期二,Ady Xiong [email protected] 写道:

我启用了2个proxy(分别是proxy1、proxy2),用jodis并发测试。在测试过程中,我手动kill掉proxy2,这个时候jodis客户端报:
redisclientsjedisexceptionsJedisConnectionException: Unexpected end of
stream
感觉jodis实现负载均衡没有起到作用,还是我使用不正确?


Reply to this email directly or view it on GitHub
#9.

Thanks,
Phil Yang

from jodis.

nsspw avatar nsspw commented on August 23, 2024

你说的”session超时时间“,是不是session_max_timeout?如果这个值很大,那等待时间是不是也很久?
我设置session_max_timeout=172800,所以一直没有切换过来

from jodis.

yangzhe1991 avatar yangzhe1991 commented on August 23, 2024

不是,是zk_session_timeout。详情见配置文件中的注释。
https://github.com/wandoulabs/codis/blob/master/config.ini#L37

from jodis.

Apache9 avatar Apache9 commented on August 23, 2024

Jodis是监控zk上结点变化来增加proxy的

首先手动kill如果是kill -9的话需要一段时间zk上的结点才会消失(取决于proxy设置的zk session超时时间)。
其次zk上的节点消失到jodis这边收到通知也有一定的时间,但最长不会超过jodis这边设置的zk session超时时间

这中间需要一个trade off,如果超时时间特别短那jodis切换就会很快,但代价就是proxy很容易因为网络抖动或者高负载而死掉。如果超时时间很长那代价就是jodis切换会很慢。

谢谢

from jodis.

nsspw avatar nsspw commented on August 23, 2024

经过测试发现,Jodis无法负载均衡,@Apache9说的很对

from jodis.

yangzhe1991 avatar yangzhe1991 commented on August 23, 2024

“无法负载均衡”是什么意思?

from jodis.

Apache9 avatar Apache9 commented on August 23, 2024

对,你说的无法负载均衡是啥意思?我的意思是jodis最终还是能把坏的节点踢掉的,只是时间长短的问题

from jodis.

nsspw avatar nsspw commented on August 23, 2024

可能我说的有点过哦,呵呵,就是像@Apache9说的:”如果超时时间很长那代价就是jodis切换会很慢“,我本地测试结果也是切换时间比较长。

from jodis.

yangzhe1991 avatar yangzhe1991 commented on August 23, 2024

你的zk_session_timeout设的是多少?

from jodis.

Apache9 avatar Apache9 commented on August 23, 2024

那你就把超时时间设短一点儿。。。这个看你业务本身的需求到底是要反应多快

from jodis.

yangzhe1991 avatar yangzhe1991 commented on August 23, 2024

还有个问题就是,无论你怎么设参数,业务上如果要求不能访问失败,肯定是要加重试的逻辑的,基于zk的HA永远是比实际的情况慢半拍的

from jodis.

nsspw avatar nsspw commented on August 23, 2024

赞同

from jodis.

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.