zfl9 / ipt2socks

将 iptables/nftables 传入的透明代理流量转为 socks5 流量的实用工具
GNU Affero General Public License v3.0
447 stars 103 forks source link

High CPU usage under few TCP/UDP connections #12

Closed ghost closed 4 years ago

ghost commented 4 years ago

Version: 5128beb7c172122ee1b0c983fb3493b0ba647df9 libuv:1.32.0 Linux Kernel: 4.14

I was trying 5128beb7c172122ee1b0c983fb3493b0ba647df9 on an OpenWRT router. It still crashes sometimes.

If it runs constantly for 20 minutes, the CPU usage will grow to 50%. After manually restart it, the CPU usage will resume to 4%. The memory usage wasn't significantly different, though.

@zfl9 Do you know what could be the reason?

zfl9 commented 4 years ago

此版本问题太多,不是非常建议使用,已打算用libev重构,不幸的是没时间去行动。

ghost commented 4 years ago

OK. FYI, there is one written with libevent, but it doesn't support UDP. https://github.com/tiernano/transocks_ev/blob/master/transocks_ev.c

zfl9 commented 4 years ago

参考倒是不需要,我缺的只是时间。。