GithubHelp home page GithubHelp logo

Nacos 1.x about udp push about nacos HOT 6 CLOSED

moutainMan avatar moutainMan commented on June 6, 2024
Nacos 1.x about udp push

from nacos.

Comments (6)

Daydreamer-ia avatar Daydreamer-ia commented on June 6, 2024

每个推送到 udp 的包都带着推送时间 lastRefTime,永远应用最新的结果。但目前不推荐使用 udp 方式了,建议升级版本到 2.x (服务端和客户端)

from nacos.

KomachiSion avatar KomachiSion commented on June 6, 2024

udp push is an enhancement way to push data to client 1.X.

Actual 1.X client use polling way to get data as core way, and the data with the lastTime to keep the data is newest data.

from nacos.

moutainMan avatar moutainMan commented on June 6, 2024

udp push is an enhancement way to push data to client 1.X.

Actual 1.X client use polling way to get data as core way, and the data with the lastTime to keep the data is newest data.

你没理解我的意思,nacos server udp是可能存在乱序的,client端并没有处理乱序问题。如果乱序,意味着client本地缓存是错误的数据,所以udp推送不算优化吧,因为你无法直到udp是否乱序。udp推送可有可无。 当然定时拉取可以保证服务状态最新

from nacos.

Daydreamer-ia avatar Daydreamer-ia commented on June 6, 2024

udp push is an enhancement way to push data to client 1.X.
Actual 1.X client use polling way to get data as core way, and the data with the lastTime to keep the data is newest data.

你没理解我的意思,nacos server udp是可能存在乱序的,client端并没有处理乱序问题。如果乱序,意味着client本地缓存是错误的数据,所以udp推送不算优化吧,因为你无法直到udp是否乱序。udp推送可有可无。 当然定时拉取可以保证服务状态最新

客户端处理了的

if (oldService.getLastRefTime() > serviceInfo.getLastRefTime()) {
    NAMING_LOGGER.warn("out of date data received, old-t: " + oldService.getLastRefTime() + ", new-t: "
           + serviceInfo.getLastRefTime());
}

from nacos.

moutainMan avatar moutainMan commented on June 6, 2024

udp push is an enhancement way to push data to client 1.X.
Actual 1.X client use polling way to get data as core way, and the data with the lastTime to keep the data is newest data.

你没理解我的意思,nacos server udp是可能存在乱序的,client端并没有处理乱序问题。如果乱序,意味着client本地缓存是错误的数据,所以udp推送不算优化吧,因为你无法直到udp是否乱序。udp推送可有可无。 当然定时拉取可以保证服务状态最新

客户端处理了的

if (oldService.getLastRefTime() > serviceInfo.getLastRefTime()) {
    NAMING_LOGGER.warn("out of date data received, old-t: " + oldService.getLastRefTime() + ", new-t: "
           + serviceInfo.getLastRefTime());
}

额,上面也只是打印呀。
再说udp乱序是由于IP层分包导致,即使你上面处理了也没用。 源码里是用一个byte数组接收,所以byte数组里面的内容可能会乱。

当然,这是历史问题,现在是长连接推送没毛病。

from nacos.

KomachiSion avatar KomachiSion commented on June 6, 2024

所以udp推送只能算是优化, 在没有乱序没有网络故障和网络防火墙的时候,能比轮询查询更快的感知到列表变化, 但是当有乱序、故障、或udp防火墙的时候,udp不可达或达的数据有问题,会通过核心的轮询查询或者最新的正确数据。

from nacos.

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.