Skip to content

开启mux后下载文件,停止下载xray还在跑流量 #232

Closed

Description

@Walter1Dumais

开启mux后下载文件,停止下载xray还在跑流量,会持续特别久
像chrome这种有预下载的浏览器,不小心点开大文件下载链接就会跑好多流量

测试图:
test.gif
客户端配置:

{
    "protocol": "vmess",
    "settings": {
        "vnext": [
            {
                "address": "IP",
                "port": 443,
                "users": [
                    {
                        "id": "UUID",
                        "alterId": 64
                    }
                ]
            }
        ]
    },
    "streamSettings": {
        "network": "ws",
        "security": "tls",
        "tlsSettings": {
            "allowInsecure": false
        },
        "wsSettings": {
            "path": "/xray"
        }
    },
    "mux": {
        "enabled": true,
        "concurrency": 8
    }
}

Activity

  1. AkinoKaede commented on Feb 3, 2021

    @AkinoKaede
    Contributor

    v2fly/v2ray-core#374 有提到过这个问题,关闭 mux 之后正常吗?

  2. Walter1Dumais commented on Feb 3, 2021

    @Walter1Dumais
    Author

    v2fly/v2ray-core#374 有提到过这个问题,关闭 mux 之后正常吗?

    关闭mux后正常

  3. RPRX commented on Feb 3, 2021

    @RPRX
    Member

    至少当前的 Mux 肯定存在历史遗留 BUG,等待更多复现

  4. Walter1Dumais commented on Feb 3, 2021

    @Walter1Dumais
    Author

    至少当前的 Mux 肯定存在历史遗留 BUG,等待更多复现

    看了下日志

    打开下载链接开始下载

    2021/02/03 09:55:27 [Info] [2395700667] proxy/socks: TCP Connect request to tcp:speed.hetzner.de:443
    2021/02/03 09:55:27 tcp:127.0.0.1:19103 accepted tcp:speed.hetzner.de:443 [inbound -> outbound]
    2021/02/03 09:55:27 [Info] [2395700667] app/dispatcher: taking detour [outbound] for [tcp:speed.hetzner.de:443]
    2021/02/03 09:55:27 [Info] [2395700667] common/mux: dispatching request to tcp:speed.hetzner.de:443
    

    中断下载,但是流量还是在持续传输

    2021/02/03 09:55:35 [Info] common/mux: failed to write to downstream. closing session 2 > io: read/write on closed pipe
    
  5. RPRX commented on Feb 3, 2021

    @RPRX
    Member

    @Walter1Dumais 试试 concurrency 设为 1

  6. Walter1Dumais commented on Feb 3, 2021

    @Walter1Dumais
    Author

    @Walter1Dumais 试试 concurrency 设为 1

    设置 concurrency 为 1 后问题改善,不过下载并发数多的时候还是会持续四五秒下载

    3个下载:总下载速度30MB/s,总上传5KB/s内
    快速中断3个下载:下载速度跳到40MB/s,上传跳到100KB/s(中断下载后,上传一定会有100KB/s),持续4-5秒后恢复正常

  7. Walter1Dumais commented on Feb 3, 2021

    @Walter1Dumais
    Author

    @Walter1Dumais 试试 concurrency 设为 1

    还是有点问题
    test.gif
    test.gif

  8. RPRX commented on Feb 3, 2021

    @RPRX
    Member

    试试同时把 policy level 0 的 uplinkOnly 和 downlinkOnly 设为 0

  9. Walter1Dumais commented on Feb 3, 2021

    @Walter1Dumais
    Author

    试试同时把 policy level 0 的 uplinkOnly 和 downlinkOnly 设为 0

        "policy": {
            "levels": {
                "0": {
                    "uplinkOnly": 0,
                    "downlinkOnly": 0
                }
            }
        }
    

    没起作用,还是有5秒左右的流量传输

  10. added
    bug
    on Feb 18, 2021
  11. qnxsgwy commented on Feb 18, 2021

    @qnxsgwy

    传统艺能,下载越大的文件越容易出现,之前mux就是因为这被逐渐淡化弃用的。

  12. Xray9 commented on Feb 20, 2021

    @Xray9
    Contributor
  13. k79e commented on Feb 20, 2021

    @k79e

    正在用 目前测试是出问题啊 不清楚其他正常使用会不会触发.
    我是用接收方中断连接那样测试的

    v2fly/v2ray-core#672 (comment)

    我都怀疑用户程序中断是不是会发送rst包还是 fin ack 我不太懂 是不是mux下面他正好忽略了这个也指不定...

  14. 9 remaining items

  15. Xray9 commented on Feb 20, 2021

    @Xray9
    Contributor

    这是我用的配置,方便在本地测试,测试方式:

    curl -x socks5://127.0.0.1:1080 -O https://dl.google.com/dl/android/aosp/redfin-rd1a.200810.020-factory-c3ea1715.zip

    等速度上来之后取消执行

    用 8b9c0ae 会发现会流量监控软件里面继续下载,用 #285 就立刻停止了

    点击查看配置文件
    {
      "log": {
        "loglevel": "debug"
      },
      "inbounds": [
        {
          "listen": "127.0.0.1",
          "port": 12345,
          "protocol": "vless",
          "settings": {
            "decryption": "none",
            "clients": [
              {
                "id": "bdbad328-37ab-4e1b-b598-08a2aa1fa3a5"
              }
            ]
          }
        },
        {
          "tag": "in",
          "listen": "127.0.0.1",
          "port": 1080,
          "protocol": "socks",
          "settings": {
            "auth": "noauth",
            "udp": false
          }
        }
      ],
      "outbounds": [
        {
          "tag": "direct",
          "protocol": "freedom"
        },
        {
          "tag": "out",
          "protocol": "vless",
          "settings": {
            "vnext": [
              {
                "address": "127.0.0.1",
                "port": 12345,
                "users": [
                  {
                    "encryption": "none",
                    "id": "bdbad328-37ab-4e1b-b598-08a2aa1fa3a5"
                  }
                ]
              }
            ]
          },
          "mux": {
            "enabled": true,
            "concurrency": 1
          }
        }
      ],
      "routing": {
        "domainStrategy": "AsIs",
        "rules": [
          {
            "type": "field",
            "inboundTag": [
              "in"
            ],
            "outboundTag": "out"
          }
        ]
      }
    }
  16. k79e commented on Feb 20, 2021

    @k79e

    你多试几次看看 顺便看下程序收发是否不对劲
    有时候没长期跑网速 但是稍微多收了一些数据.

  17. Xray9 commented on Feb 20, 2021

    @Xray9
    Contributor

    用 #232 (comment) 测试可以跑满带宽,比如你是 Windows,在性能监视器里能看到网络使用率 100%,而在原先代码的情况下,中断满速下载,mux会无法正确处理中断的信号,就会继续满速下载一段时间,#285 修复之后网络使用率就会立刻降到 0%

    你可以先试试按照 #232 (comment) 的配置和方式在本地测试,而不是在公网测试 @k79e

  18. k79e commented on Feb 20, 2021

    @k79e

    @SekiBetu 多收4%就有问题了. 一般测试也就2-3
    多个40-50乃是好几倍就太大了.
    #232 (comment) 如图多了13倍根本就是炸了

  19. k79e commented on Feb 20, 2021

    @k79e
  20. Xray9 commented on Feb 20, 2021

    @Xray9
    Contributor

    @k79e 在社区请保持友好的态度进行交流

  21. k79e commented on Feb 20, 2021

    @k79e
  22. Xray9 commented on Feb 20, 2021

    @Xray9
    Contributor
  23. Xray9 commented on Feb 20, 2021

    @Xray9
    Contributor

    #232 (comment)

    mux 的 concurrency 调大也表现正常,有条件测试的朋友可以测一下, 多跑一点,,,

  24. k79e commented on Feb 20, 2021

    @k79e

    发现新bug了 mux下暂停文件导致网络没法用.
    1L也是那样么?

    更奇怪的是点了取消反而网速跑满一下子.

  25. Xray9 commented on Feb 20, 2021

    @Xray9
    Contributor

    你在本地跑的话可以多跑一段时间,等速度上来了再取消下载观察(监视器也有刷新时间),这个配置不会走你 VPS 的流量,不要紧的

  26. added a commit that references this issue on Mar 4, 2021
  27. z826540272 commented on Mar 15, 2021

    @z826540272

    确实有这个问题,而且这个问题和服务端有关
    我两家机场,一家有这个问题,一家没有,但是没有的那家mux连接到无法访问的ip会导致挂起

  28. yuhan6665 commented on Apr 23, 2021

    @yuhan6665
    Member

    能复现问题的同学可以试一下这个版本,把客户端和服务器都换了 https://github.com/XTLS/Xray-core/actions/runs/776267875
    代码 #535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions