v2fly / v2ray-core

A platform for building proxies to bypass network restrictions.
https://v2fly.org
MIT License
28.94k stars 4.58k forks source link

在 ASUS 路由器上做透明代理,从 v4.35.1 升级到 v4.37.3 之后,速度明显变慢,变卡。(之前工作的很好) #918

Closed zw963 closed 3 years ago

zw963 commented 3 years ago

你正在使用哪个版本的 V2Ray?

我是 asuswrt-merlin-v2ray的维护者, 通过 ASUS AC5300 梅林系统作为透明代理被使用。平常就是浏览网页,上 Youtube. 最近刚刚升级到 4.37.3, 客户端使用 v2ray-linux-arm32-v5.zip, 服务端是 x86_64 版本。

你看到的异常现象是什么?

我使用 4.35.1 好长是段时间了,效果非常好,但是在前两天升级到 4.37.3 之后,一直卡、慢。 而同时期,我并没有更换 VPS, 而且,VPS 上同时有 shadowsocks-libev 服务,速度并未受到影响。

目前怀疑可能是路由器过高的 CPU 占用造成的。

你期待看到的正常表现是怎样的?

速度应该和老版本一致,甚至更好一些。

请附上你的配置

请帮我检查是不是我的配置和新版本一起使用有问题? 是不是因为我使用 Quic, 而 Quic 升级了的缘故? 请指教。

服务器端

{
    "log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
    "dns": {
        "servers": [
            "https+local://dns.google/dns-query"
        ]
    },
    "inbounds": [
        {
            "protocol": "vmess",
            "port": 22334,
            "settings": {
                "clients": [
                    {
                        "id": "2bf5f6e4-4b46-4d55-9e06-3237eec6beab",
                        "alterId": 4
                    }
                ]
            },
            "streamSettings": {
                "network": "quic",
                "quicSettings": {
                    "header": {
                        "type": "wechat-video"
                    }
                }
            }
        },
        {
            "protocol": "shadowsocks",
            "port": 22335, // 监听端口
            "settings": {
                "method": "chacha20-ietf-poly1305",
                "password": "aaaaaa"
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "settings": {}
        },
        {
            "tag": "block",
            "protocol": "blackhole",
            "settings": {}
        }
    ],
    "routing": {
        "rules": [
            {
                "type": "field",
                "ip": [
                    "geoip:private"
                ],
                "outboundTag": "block"
            }
        ]
    },
    "policy": {
        "levels": {
            "0": {
                "bufferSize": 1024
            }
        }
    }
}

### 客户端

```json
{
    // "log": {
    //     "loglevel": "info"
    // },
    "dns": {
        "clientIp": "120.92.83.126",
        "hosts": {
            // "baidu.com": "127.0.0.1"
        },
        "servers": [
            {
                "address": "202.99.192.66",
                "port": 53,
                "domains": [
                    "geosite:cn"
                ],
                "expectIPs": [
                    "geoip:cn"
                ]
            },
            {
                "address": "https://dns.google/dns-query",
                "domains": [
                    "geosite:geolocation-!cn"
                ]
            },
            "114.114.114.114"
        ]
    },
    "routing": {
        "rules": [
            {
                "type": "field",
                "domain": [
                    "services.googleapis.cn"
                ],
                "outboundTag": "proxy"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:cn"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "ip": [
                    "geoip:cn"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "inboundTag": "dns-inbound",
                "outboundTag": "dns-outbound"
            },
            {
                "type": "field",
                "domain": [
                    "dns.google"
                ],
                "outboundTag": "proxy"
            },
            {
                "type": "field",
                "ip": [
                    "8.8.4.4"
                ],
                "outboundTag": "proxy"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:category-ads"
                ],
                "outboundTag": "block"
            },
            {
                "type": "field",
                "protocol":[
                    "bittorrent"
                ],
                "outboundTag": "direct"
            }
        ]
    },
    "inbounds": [
        {
            "protocol": "dokodemo-door",
            "port": 1081, 
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls"
                ]
            },
            "settings": {
                "network": "tcp,udp",
                "followRedirect": true
            }
        },
        {
            "tag": "dns-inbound",
            "protocol": "dokodemo-door",
            "port": 65053,
            "settings": {
                "address": "8.8.4.4",
                "port": 53,
                "network": "tcp,udp"
            }
        },
        {
            "protocol": "socks", 
            "port": 1080, 
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls"
                ]
            },
            "settings": {
                "auth": "noauth"  
            }
        },
        {
            "protocol": "http",
            "port": 3128,
            "settings": {
                "timeout": 0
            }
        }
    ],
    "outbounds": [
        {
            "tag": "proxy",
            "protocol": "vmess", 
            "settings": {
                "vnext": [
                    {
                        "address": "ip_address", 
                        "port": 22334,  
                        "users": [
                            {
                                "id": "2bf5f6e4-4b46-4d55-9e06-3237eec6beab",
                                "alterId": 4 
                            }
                        ]
                    }
                ]
                // "domainStrategy": "UseIP"
            },
            "streamSettings": {
                "network": "quic",  
                "quicSettings": {
                    "header": {
                        "type": "wechat-video"
                    }
                },
                "sockopt": {
                    "tproxy": "redirect",
                    "mark": 255
                }
            },
            "mux": {"enabled": true}
        },
        {
            "protocol": "shadowsocks",
            "settings": {
                "servers": [
                    {
                        "address": "my_ip",
                        "method": "chacha20-ietf-poly1305", 
                        "password": "aaaaaa", 
                        "port": 22335
                    }
                ]
            }
        },
        {
            "tag": "dns-outbound",
            "protocol": "dns",
            "proxySettings": {
                "tag": "proxy"
            }
        },
        {
            "tag": "direct",
            "protocol": "freedom",
            "streamSettings": {
                "network": "tcp", 
                "sockopt": {
                    "mark": 255
                }
            }
        },
        {
            "tag": "block",
            "protocol": "blackhole",
            "settings": {
                "response": {
                    "type": "http"
                }
            }
        }
    ],
    "policy": {
        "levels": {
            "0": {
                "bufferSize": 4
            }
        }
    }
}
kslr commented 3 years ago

你能提供一个测速对比吗

zw963 commented 3 years ago

你能提供一个测速对比

抱歉,可能不够严谨,因为我换成最新的 4.37.3 之后,并未再换回 4.35.1 重新测试下,主要是凭借个人 看 Youtube 视频的体验来定论的。

简单的体验,就是之前看 Youtube, 480p 完全无压力, 甚至 720p 也基本凑合,没有停顿,但是现在即使 480P, 相当频繁的出现播放几秒,就缓冲一下。但是经过测试,浏览器直接切换使用 shadowsocks-libev 提供的 socks 5 代理(同一服务器),效果要明显好。

zw963 commented 3 years ago

@kslr , 是否有可能这个情况。

服务端/客户端升级为新版本后,很多缓存需要重新创建,因此,在一段时间内,速度会感觉明显慢下来?

毕竟, 4.35.1 我用好一段时间了,4.37.3 才刚刚开始用。