SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
19.93k stars 2.36k forks source link

Decreased `hysteria` type outbound performance after upgrading from 1.4.0-beta.6 to any futher release #872

Closed zeerayne closed 1 year ago

zeerayne commented 1 year ago

Operating system

Android

System version

13.0

Installation type

sing-box for Android Graphical Client

If you are using a graphical client, please provide the version of the client.

1.4.0-rc.1 and futher

Version

No response

Description

Versions 1.4.0-beta.6 and lower works without issues, but if I upgrade to 1.4.0-rc.1 or newer, I have issues which can be described as "unstable" connection: some http requests are failing to complete.

Have checked on 5 devices

All five are facing problem in same way

Reproduction

The easiest way to reproduce is to try opening any instagram profile. Some posts/video content will fail to load.

Config

{
  "log": {
    "level": "panic"
  },
  "dns": {
    "servers": [
      {
        "tag": "dns-remote",
        "address": "https://8.8.8.8/dns-query",
        "address_resolver": "dns-direct",
        "strategy": "ipv4_only"
      },
      {
        "tag": "dns-direct",
        "address": "https://9.9.9.9/dns-query",
        "address_resolver": "dns-local",
        "strategy": "ipv4_only",
        "detour": "direct"
      },
      {
        "tag": "dns-local",
        "address": "local",
        "detour": "direct"
      },
      {
        "tag": "dns-block",
        "address": "rcode://success"
      }
    ],
    "independent_cache": true
  },
  "inbounds": [
    {
      "type": "direct",
      "tag": "dns-in",
      "listen": "127.0.0.1",
      "listen_port": 6450,
      "override_address": "8.8.8.8",
      "override_port": 53
    },
    {
      "type": "tun",
      "tag": "tun-in",
      "mtu": 9000,
      "interface_name": "tun0",
      "auto_route": true,
      "inet4_address": "172.19.0.1/28",
      "endpoint_independent_nat": true,
      "stack": "system",
      "sniff": true
    },
    {
      "type": "mixed",
      "tag": "mixed-in",
      "listen": "127.0.0.1",
      "listen_port": 2080,
      "sniff": true
    }
  ],
  "outbounds": [
    {
      "type": "hysteria",
      "tag": "proxy",
      "server": "***",
      "server_port": "***",
      "up_mbps": 15,
      "down_mbps": 15,
      "obfs": "***",
      "auth": "***",
      "tls": {
        "enabled": true,
        "server_name": "***",
        "alpn": ["***"]
      }
    },
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "direct",
      "tag": "bypass"
    },
    {
      "type": "block",
      "tag": "block"
    },
    {
      "type": "dns",
      "tag": "dns-out"
    }
  ],
  "route": {
    "rules": [
      {
        "port": 53,
        "outbound": "dns-out"
      },
      {
        "inbound": "dns-in",
        "outbound": "dns-out"
      },
      {
        "source_ip_cidr": [
          "224.0.0.0/3",
          "ff00::/8"
        ],
        "ip_cidr": [
          "224.0.0.0/3",
          "ff00::/8"
        ],
        "geosite": [
          "category-ads"
        ],
        "outbound": "block"
      },
      {
        "domain_suffix": [
          ".ru"
        ],
        "geoip": [
          "ru", 
          "private"
        ],
        "geosite": [
          "googlefcm"
        ],
        "ip_cidr": [
          "17.0.0.0/8",
          "2620:149:a44::/48",
          "2403:300:a42::/48",
          "2403:300:a51::/48",
          "2a01:b740:a42::/48"
        ],
        "outbound": "direct"
      },
      {
        "inbound": "tun-in",
        "geoip": ["!ru"],
        "outbound": "proxy"
      }
    ],
    "auto_detect_interface": true
  }
}

Logs

No response

Mahdi-zarei commented 1 year ago

try setting "disable_mtu_discovery": true

zeerayne commented 1 year ago

That definitely works! Thank you, from documentation it was not obvious for me that this setting work on platforms other that Linux and Windows