V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
p64381
V2EX  ›  问与答

ipset hash:ip 查询 和 路由表查询 哪个快一些呢

  •  
  •   p64381 · Mar 14, 2018 · 1843 views
    This topic created in 2977 days ago, the information mentioned may be changed or developed.
    路由表中的 ip 不许额外设置就能分流,ipset 里面的 ip 还要转好几圈才能分流。
    ipset 是为了把大量 ip 的流量定向到某个端口而产生的。

    直接用路由表的缺陷:
    dnsmasq 没有能操作路由表的设置, 需要自己 patch。
    路由表没有 ipset 那种超时机制, 需要自己维护。
    2 replies    2018-03-15 10:23:21 +08:00
    LGA1150
        1
    LGA1150  
       Mar 15, 2018 via Android
    时间复杂度 路由表 O(n),哈希表 O(1)
    p64381
        2
    p64381  
    OP
       Mar 15, 2018
    @LGA1150 linux 路由表要是 O(n) 就没法活了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2969 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 15:27 · PVG 23:27 · LAX 08:27 · JFK 11:27
    ♥ Do have faith in what you're doing.