v2ray / v2ray-core

A platform for building proxies to bypass network restrictions.
https://www.v2ray.com/
MIT License
45.37k stars 8.94k forks source link

V2Ray在油管直播视频清晰度会周期性卡死,部分视频没有预览,是配置还是什么原因?另外是否支持多线程下载? #385

Closed silentstage closed 7 years ago

silentstage commented 7 years ago

今天把AWS服务器重置了来装V2Ray测试,准备测试好了部署到Vultr上,测试结果有点怪异。 在线看油管会周期性卡死,内置ss没有这问题。而用浏览器内置迅雷下载速度和内置ss在线播放差不多,没有明显改善,而SSR能够多线程下载,速度非常快。之前用SS-libev也能多线程,今天没有部署没有同时测试。

有几个疑问,感谢解答 1.V2Ray不支持迅雷这种多线程?(用户角度理解,完全不懂代码这些,安装都是google和这两年折腾SS折腾出来的,如果理解有误勿怪),测试迅雷主要习惯把视频拖回本地再播放,可以完全避免卡顿。

2.断流的问题是不是我配置文件有问题引起的?

3.服务器能安装锐速或者BBR,是不是就没必要配置mKCP模式了?

我测试具体情况都在下面,尽量的弄得详细一点,看起来有点多-_-。

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) 2.17.1

2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 1.Vmess,V2ray自带SS,SSR最新版通过Chrome看油管 2.同上通过360极速整合的迅雷下载油管视频(多线程)

3) 你看到的不正常的现象是什么? Vmess在chrome看油管的时候,会周期性的会卡死没有流量,SwitchyOmega会出现一大堆资源未加载,过很久会走一点进度条,又卡很久,很多youtube视频预览直接看不到,图片也是。改用内置ss一切正常

4) 测速比较 本地环境:windows10,软件都是最新版,Chrome Dev,360极速,都带SwitchyOmega,SSR,电信100M宽带。 服务器:Ubuntu 16.04,AWS EC2免费套餐,安装BBR加速,部署了V2Ray和SSR

Chrome看视频情况,SSR大概平均500KB,V2Ray+ss大概300+,V2Ray+Vmess工作不正常,流量时有时无。 360极速浏览器下载,这里差别就大了,SSR峰值11MB,几乎跑满带宽,平均5MB以上。V2Ray ss或者Vmess都差不多,平均500KB,峰值最高1MB多一点。感觉和直接看youtube几乎没太大区别。

5) 请附上你的配置文件(提交 Issue 前请隐藏服务器端IP地址)。 客户端配置 { "log": { "loglevel": "warning" }, "inbound": { "port": 2080, "listen": "127.0.0.1", "protocol": "socks", "settings": { "auth": "noauth", "udp": false, "ip": "127.0.0.1" } }, "outbound": { "protocol": "vmess", "settings": { "vnext": [ { "address": "", "port": 33333, "users": [ { "id": "", "alterId": 100, "security": "auto" } ] } ] } }, "outboundDetour": [ { "protocol": "freedom", "settings": {}, "tag": "direct" } ], "dns": { "servers": [ "8.8.8.8", "8.8.4.4", "localhost" ] }
}

服务端配置: { "log" : { "access": "/var/log/v2ray/access.log", // 访问日志文件 "error": "/var/log/v2ray/error.log", // 错误日志文件 "loglevel": "warning" // 错误日志等级,可选 debug / info / warning / error }, "inbound": { "port": 33333, // 主端口 "protocol": "vmess", // 主传入协议,参见协议列表 "settings": { "clients": [ { "id": "", // 用户 ID,客户端须使用相同的 ID 才可以中转流量 "level": 1, // 用户等级,自用 VPS 可设为 1;共享 VPS 请设为 0。 "alterId": 100 } ] } }, "outbound": { "protocol": "freedom", // 主传出协议,参见协议列表 "settings": {} }, "inboundDetour": [ { "protocol": "shadowsocks", // 开启 Shadowsocks "port": 22233, // 监听 30001 端口 "settings": { "method": "aes-128-cfb", // 加密方式,支持 aes-256-cfb 和 aes-128-cfb "password": "fuckgfw", // 密码,必须和客户端相同 "udp": true, // 是否开启 UDP 转发 "level": 1 } }, { "protocol": "shadowsocks", // 开启 Shadowsocks "port": 22234, // 监听 30002 端口,由于 Shadowsocks 的限制,多用户的时候只能开多个端口 "settings": { // 配置和上述类似 "method": "aes-256-cfb", "password": "fuckgfw1314", "udp": true, "level": 1 } } ], "outboundDetour": [ { "protocol": "blackhole", // 额外的传出协议,参见协议列表 "settings": {}, "tag": "blocked" } ], "routing": { "strategy": "rules", "settings": { "rules": [ { "type": "field", // 路由设置,默认将屏蔽所有局域网流量,以提升安全性。 "ip": [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "::1/128", "fc00::/7", "fe80::/10" ], "outboundTag": "blocked" } ] } } }

6) 请附上出错时软件输出的日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。 2017/02/07 12:40:40 [Warning]V2Ray started. 2017/02/07 12:47:35 [Warning]Freedom: Failed to open connection to tcp:youtubecom:80: All retry attempts failed. 2017/02/07 12:47:38 [Warning]Freedom: Failed to open connection to tcp:youtube.c:80: All retry attempts failed. 2017/02/07 12:47:39 [Warning]Freedom: Failed to open connection to tcp:youtubec:80: All retry attempts failed. 2017/02/07 12:47:40 [Warning]Freedom: Failed to open connection to tcp:www.youtubecom:80: All retry attempts failed. 2017/02/07 12:47:40 [Warning]Freedom: Failed to open connection to tcp:youtubeco:80: All retry attempts failed. 2017/02/07 12:47:42 [Warning]Freedom: Failed to open connection to tcp:youtube:80: All retry attempts failed. 2017/02/07 12:47:42 [Warning]Freedom: Failed to open connection to tcp:www.youtube.c:80: All retry attempts failed. 2017/02/07 12:47:42 [Warning]Freedom: Failed to open connection to tcp:www.youtubec:80: All retry attempts failed. 2017/02/07 12:47:43 [Warning]Freedom: Failed to open connection to tcp:www.youtubeco:80: All retry attempts failed. 2017/02/07 12:57:52 [Warning]Freedom: Failed to open connection to tcp:www.localnetwork.uop:80: All retry attempts failed. 2017/02/07 12:57:53 [Warning]Freedom: Failed to open connection to tcp:www.localnetwork.uop:80: All retry attempts failed. 2017/02/07 12:57:54 [Warning]Freedom: Failed to open connection to tcp:www.localnetwork.uop:80: All retry attempts failed. 2017/02/07 13:50:40 [Warning]V2Ray started. 2017/02/07 14:24:08 [Warning]V2Ray started. 2017/02/07 14:35:42 [Warning]V2Ray started. 2017/02/07 14:47:09 [Warning]Freedom: Failed to open connection to tcp:www.localnetwork.uop:80: All retry attempts failed. 2017/02/07 14:47:10 [Warning]Freedom: Failed to open connection to tcp:www.localnetwork.uop:80: All retry attempts failed. 2017/02/07 14:47:13 [Warning]Freedom: Failed to open connection to tcp:www.localnetwork.uop:80: All retry attempts failed. 2017/02/07 14:58:47 [Warning]V2Ray started. ~

silentstage commented 7 years ago

刚查了下access.log,出现大量的这个信息

2017/02/07 16:04:14 14.106.98.136:9144 rejected VMess|Server: Failed to read request header. > read tcp 172.31.1.87:33333->14.106.98.136:9144: i/o timeout 2017/02/07 16:04:14 14.106.98.136:9145 rejected VMess|Server: Failed to read request header. > read tcp 172.31.1.87:33333->14.106.98.136:9145: i/o timeout

每次SwitchyOmega出现1个资源未加载,服务器端都会有个这个log

kailiu42 commented 7 years ago

我之前用老一点的版本的时候倒是经常出现大量流量的时候断流的问题,但是从2.15版本开始感觉出现得比较少了,个人感觉最近2.15,2.16的最后一个小版本和最近的2.17.1都很稳定,基本没有断流的情况。不过这个很难讲,断流你也不清楚到底是v2ray的问题,还是你的VPS被关注了,还是单纯的国际出口堵塞造成的。。。太多可能性了。如果你怀疑是自己配置的问题,可以看一下我提过的issue,里面有我的配置文件,用我的试试看。

我的经验用BBR带来的提速效果很明显,普通TCP单线程下载100k不到,KCP和BBR在稳定后都能达到2M甚至更高的速度,而BBR不会断流,KCP会。即便KCP能带来更高的带宽,也不值得。我测试过的环境有美国和日本的VPS。所以如果对你来讲BBR带来的提速效果已经很好,建议就不要再用KCP了。原因有:

  1. KCP会带来比较大的带宽浪费。如果你的VPS流量够用还好说,比较吃紧的话就不合适了。
  2. KCP本质上是涸泽而渔的做法,狂发UDP包对网络整体的影响较大。如果大家都用KCP,对网络环境是不好的。
  3. 很多人用KCP(例如kcptun)的人都反映过断流的问题,而且很难解决。据我的理解,实际上不是KCP软件实现的问题,而是很多网络服务商会把狂发UDP包的行为识别为恶意行为,例如拒绝服务攻击,从而进行限制。
silentstage commented 7 years ago

应该能排除被关注和出口问题,因为同服务器的SSR,自己v2ray的ss协议都不会有断流现象,只有用vmess才会。我找下你的配置晚上试试看,谢谢回复

silentstage commented 7 years ago

抄你的json后试了下,加http混淆始终要出EOF,不知道为什么,删掉后就没问题,但是还是有断流-_-,怀疑服务器问题,我在Vultr上又部署了个,结果还是有断流现象,而且速度一直起不来,郁闷了.....

kailiu42 commented 7 years ago

你是不是用的 issue #380 里面的配置?新版本的要用这,之前我还有个issue里面的配置是适用于老版本的。

betterdoitnow commented 7 years ago

@silentstage 关于断流,我这边有一模一样的问题,log都是一样的 i/o timeout,SwitchyOmega也有报错。 我的解决方法:把客户端 outbound中的 "security": "auto" 改为 "aes-128-cfb"

betterdoitnow commented 7 years ago

@silentstage 关于你说的速度比较慢,你用Vultr的IPv6了么? 用v2ray,然后浏览器访问redirector.googlevideo.com/report_mapping 看看显示的哪个IP,被分配到哪里的Youtube服务器了?

silentstage commented 7 years ago

@betterdoitnow 没用IPv6,我说的慢是和SSR还有客户端内置的SS比较的,速度差一大截还不稳定,和大家的体验是两码事,所以怀疑配置哪里有问题,我试试security改了试试

betterdoitnow commented 7 years ago

@silentstage 你试试改一下secuirity,如果有改善,反馈一下,然后我们一起给老大反馈bug

v2ray commented 7 years ago

多线程问题应该是由于之前的一个问题引起的,在 2.18 中已修复。

加密方式的问题暂时无法重现,还不能判断是否是加密导致的断流。

silentstage commented 7 years ago

@v2ray 我更新2.18后问题解决了,多线程也正常了,但是一直有大量这个提示Failed to process outbound traffic: context canceled,不怎么影响使用。手机电脑使用了2天,感觉速度和SSR差不多,但是稳定性要差一些,偶尔会莫名的断流一下,翻log也没看到什么特别的提示。换KCP模式后非常不稳定,经常断流。

v2ray commented 7 years ago

不影响使用的话,那个 warning 可以不用管,下一个版本会修

silentstage commented 7 years ago

@v2ray 嗯,先用着,目前体验还不错,就是偶尔出现断流得重启一次客户端才行,稳定性有待加强,感谢解答。