Giter VIP home page Giter VIP logo

Comments (7)

jlijian3 avatar jlijian3 commented on July 16, 2024

@tanxi
sysctl_ip_vs_expire_nodest_conn设为1,见ip_vs_core.c:1162
sysctl
net.ipv4.vs.expire_nodest_conn = 1

from lvs.

tanxi avatar tanxi commented on July 16, 2024

@tanxi
sysctl_ip_vs_expire_nodest_conn设为1,见ip_vs_core.c:1162
sysctl
net.ipv4.vs.expire_nodest_conn = 1

非常感谢!我测试一下这个配置。

from lvs.

tanxi avatar tanxi commented on July 16, 2024

@tanxi
sysctl_ip_vs_expire_nodest_conn设为1,见ip_vs_core.c:1162
sysctl
net.ipv4.vs.expire_nodest_conn = 1

@jlijian3 你好,我验证了一下这个参数,rs 的 weight 被设置成 0 后,流量立刻被摘掉了,非常感谢!

不过现在又有一个新的不懂之处0-0. 我在网上查询了一下这个参数,然后发现了另外一个参数:expire_quiescent_template,参考的这份文档:https://www.kernel.org/doc/Documentation/networking/ipvs-sysctl.txt
我的理解是,expire_nodest_conn 是对直接从 ipvs 里删除 rs 时生效,expire_quiescent_template 是对把 rs weight 设置成 0 时生效,但是在测试的时候,把 expire_quiescent_template 参数设置成 1,并不能马上摘除流量,而 expire_nodest_conn 这个参数,对是否配置 inhibit_on_failure 参数,都能立马摘除流量。是我的理解错了吗?

from lvs.

jlijian3 avatar jlijian3 commented on July 16, 2024

@tanxi
expire_quiescent_template是针对配置了 persistence_timeout的vs
weight=0,新建连接不会分配给这个rs,但旧的连接仍然能继续转发包,所以流量不能马上摘除
ipvs删除rs,会把rs状态置为UNAVALIBLE,不会直接删除,已经建立的连接直接丢弃包
expire_nodest_conn = 1 :就是如果rs状态是UNAVALIBLE,已经建立的连接收到包马上超时,从连接表删除,不管你weight是否为0

from lvs.

jlijian3 avatar jlijian3 commented on July 16, 2024

@tanxi 流量没有马上摘除,估计是因为client和rs重传包
expire_nodest_conn使连接快速超时,重传包没有命中ipvs的连接,DR模式会继续走向协议栈上层,触发内核发送tcp reset。
如果是FULLNAT,NAT的话ipvs会自己发送reset

from lvs.

tanxi avatar tanxi commented on July 16, 2024

@tanxi
expire_quiescent_template是针对配置了 persistence_timeout的vs
weight=0,新建连接不会分配给这个rs,但旧的连接仍然能继续转发包,所以流量不能马上摘除
ipvs删除rs,会把rs状态置为UNAVALIBLE,不会直接删除,已经建立的连接直接丢弃包
expire_nodest_conn = 1 :就是如果rs状态是UNAVALIBLE,已经建立的连接收到包马上超时,从连接表删除,不管你weight是否为0

@jlijian3
hi,设置 expire_nodest_conn = 1,当rs状态是UNAVALIBLE时,是LVS会立马返回 reset 给client吧?测试中有看见大量 Connection reset,这样在大流量情况下,还是会影响到服务,有更优雅的方式摘除 RS 吗?

from lvs.

tanxi avatar tanxi commented on July 16, 2024

@tanxi
expire_quiescent_template是针对配置了 persistence_timeout的vs
weight=0,新建连接不会分配给这个rs,但旧的连接仍然能继续转发包,所以流量不能马上摘除
ipvs删除rs,会把rs状态置为UNAVALIBLE,不会直接删除,已经建立的连接直接丢弃包
expire_nodest_conn = 1 :就是如果rs状态是UNAVALIBLE,已经建立的连接收到包马上超时,从连接表删除,不管你weight是否为0

@jlijian3
hi,设置 expire_nodest_conn = 1,当rs状态是UNAVALIBLE时,是LVS会立马返回 reset 给client吧?测试中有看见大量 Connection reset,这样在大流量情况下,还是会影响到服务,有更优雅的方式摘除 RS 吗?

配置 inhibit_on_failure 后,请求不再有返回 Connection reset

from lvs.

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.