Comments (12)
这个应该和 ss-tproxy 没关系,建议查看 代理程序 的日志和配置,以及内核相关网络参数,可以优化下。
有很多因素:
- 代理程序的配置,如 nofile 设置不当,导致同时允许打开的文件数量(socket 数量)受到限制。
- 代理程序自身的处理能力,针对这种情况,可以多开几个代理进程(利用 so_reuseport 特性)。
- ss-tproxy 主机的内核参数,比如 nr_open、file-max,可能限制了同时可打开的文件数。
- 代理节点(VPS)的承载能力,代理进程多开时,不要只用一个节点,多用几个,将流量分散。
- 还有其他因素,如代理协议本身的抗干扰能力,在流量大、连接数多的时候是否抵得住GFW、ISP的干扰。
from ss-tproxy.
总之,需要结合 ss-tproxy 主机的内核参数/配置、dmesg日志、代理进程的日志、配置信息 等分析。
from ss-tproxy.
ss-tproxy 这边只是设置代理环境、代理规则,真正的运行过程,特别是处理能力,取决于代理自身。
from ss-tproxy.
抱歉,是我没说清楚.
同一台软路由上.,
跑的是Naive代理.socket端口在1080.SS-TPROXY在60080
当连接重置发生时.
电脑A直接配置经过socket 1080端口上网,没问题,
电脑B,DNS,Gateway指向旁路由IP,.浏览器报连接重置,但多刷几次,可以刷出来
另一个部门,windows机器配置代理http://软路由IP/gfw.pac上网,一切正常,不管多少线程都稳住
这个pac指向的,也是软路由socket 1080端口
也就是说,只要不走ss-tproxy规则及处理的,就没问题
from ss-tproxy.
那就要看看 ss-tproxy 主机自身的内核参数配置、特别是要结合日志分析,要看是什么原因导致链接重置,只看现象没帮助。
看你描述,你的代理是跑在其他主机上(native)上吗?也就是说,ss-tproxy 主机和你的 native 主机不是同一个?
这种情况下,你是在 ss-tproxy 主机上使用了 ipt2socks 对接 native 主机上的 socks5 端口么?
from ss-tproxy.
ss-tproxy 主机和native 主机是同一个,
是的,用了ipt2socks对接socks5 端口
from ss-tproxy.
那就检查 ipt2socks 日志,估计是 nofile 达到 limit 了。可以使用 ipt2socks 的 --nofile-limit 100000
提高下(需要 root 权限)
$ ipt2socks --help
-j, --thread-nums <num> number of the worker threads, default: 1
-n, --nofile-limit <num> set nofile limit, may need root privilege
另外建议指定 -j
选项,启用多线程(SO_REUSEPORT)。
from ss-tproxy.
hi,感谢回覆
但我有点困惑,
不管是执行
ipt2socks -j4 -n100000 -r
或是ipt2socks -j4 -n 100000 -r
得到的都是
2024-03-07 22:31:56 INF: [main] server address: 127.0.0.1#1080
2024-03-07 22:31:56 INF: [main] listen address: 127.0.0.1#60080
2024-03-07 22:31:56 INF: [main] listen address: ::1#60080
2024-03-07 22:31:56 INF: [main] udp cache maximum size: 256
2024-03-07 22:31:56 INF: [main] udp socket idle timeout: 60
2024-03-07 22:31:56 INF: [main] number of worker threads: 4
2024-03-07 22:31:56 INF: [main] enable tcp transparent proxy
2024-03-07 22:31:56 INF: [main] enable udp transparent proxy
2024-03-07 22:31:56 INF: [main] always enable reuseport feature
似乎nofile-limit配置不起作用?
from ss-tproxy.
nofile-limit 不会显示出来的。
from ss-tproxy.
可以使用 prlimit -p ipt2socks进程ID
来检查 NOFILE 行(SOFT 列),是否设置生效。
通常来说,如果设置失败,ipt2socks 会打印一条错误信息的,如果没有错误(比如你这个),就是成功了。
from ss-tproxy.
感谢,配置好之后,问题解决了
from ss-tproxy.
也可以这样查看 limits :
cat /proc/$(pgrep -x ipt2socks)/limits
from ss-tproxy.
Related Issues (20)
- wiki dnsr方案 自定义 DNS 中chinadns-ng 的参数是不是有问题? HOT 1
- 开启ss-tproxy ,ipv6 不通,请作者看看 HOT 3
- 大侠你好:遇到这个问题,麻烦帮我解决,谢谢了! HOT 95
- 请教如何配置xray reality HOT 6
- ss-redir默认单线程运行, 可使用--reuse-port启用多进程负载均衡,发挥多核性能 HOT 6
- 无法启动proxy/tcp和proxy/udp HOT 39
- N1盒子挂在路由器下面,安装了ss-troxy.N1上能够正常跑透明代理。但是如果连接路由器的设备设置用N1盒子做网关,就无法上网 HOT 3
- 有支持 windows主机的方案吗? HOT 7
- 透明代理能设置转发访问端口白名单吗? HOT 11
- 升级脚本后 chinadns 无法开启,启动失败 HOT 18
- 关于ipts_proxy_dst_port的疑问 HOT 41
- 只有http代理应该如何使用 HOT 4
- 在树莓派5上运行.,不起作用 (tproxy模式但ss-redir缺少"tcp_tproxy": true) HOT 16
- Question.请问如何配置DNS HOT 4
- iptables相关内核模块缺失
- 端口检测时机的小疑问 HOT 3
- 教程修改建议,关于naive,. HOT 4
- 新版的能在ss-tproxy.conf里添加个设置参数来过滤IPV6吗? HOT 3
- 有关远程局域网 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ss-tproxy.