redsocks icon indicating copy to clipboard operation
redsocks copied to clipboard

cpu load high

Open ownhere opened this issue 11 years ago • 18 comments

在autoproxy模式几乎无法正常工作。 在非autoproxy模式下运行时间长了也会导致cpu占用率99%。 不知是哪里的问题。

ownhere avatar Apr 13 '15 06:04 ownhere

你可能是开了 redudp 且 redudp的超时值设置的很长(用于 DNS建议值是 3或4),导致 file descriptor被用完。

Semigod King 2015年4月13日 下午2:08于 "ownhere" [email protected]写道:

在autoproxy模式几乎无法正常工作。 在非autoproxy模式下运行时间长了也会导致cpu占用率99%。 不知是哪里的问题。

— Reply to this email directly or view it on GitHub https://github.com/semigodking/redsocks/issues/7.

semigodking avatar Apr 13 '15 06:04 semigodking

多谢回答,不过我没有开redudp。而且用了autoproxy模式后,好像导致客户机联网速度极大下降,不知是不是redsocks2中的直连尝试实现有问题。目前我的解决办法是每小时强制重启一次redsocks2。 另外的问题是redsocks2每次会fork一个额外的进程出来,导致启动脚本的stop动作无法完成。所以目前我是在stop()中做了额外的ps|kill操作。

ownhere avatar Apr 13 '15 07:04 ownhere

那你可能要检查一下,是不是出现了 redirection的 loop。如果你的客户机很多的话,建议通过 ulimit -n 设置更大的允许打开文件数。如果不想 fork出两个,你需要改配置关闭 daemon模式。但在目前版本不建议。

Semigod King 2015年4月13日 下午3:54于 "ownhere" [email protected]写道:

多谢回答,不过我没有开redudp。而且用了autoproxy模式后,好像导致客户机联网速度极大下降,不知是不是redsocks2中的直连尝试实现有问题。目前我的解决办法是每小时强制重启一次redsocks2。

另外的问题是redsocks2每次会fork一个额外的进程出来,导致启动脚本的stop动作无法完成。所以目前我是在stop()中做了额外的ps|kill操作。

— Reply to this email directly or view it on GitHub https://github.com/semigodking/redsocks/issues/7#issuecomment-92256700.

semigodking avatar Apr 13 '15 10:04 semigodking

@semigodking 如果我想编译一个稳定版本.我需要选择哪个commit?我目前在openwrt trunk上用的会不定时死掉.

ghostry avatar Apr 18 '15 14:04 ghostry

最新的 commit已经基本上不会死掉了

Semigod King 2015年4月18日 下午10:57于 "ghostry" [email protected]写道:

@semigodking https://github.com/semigodking 如果我想编译一个稳定版本.我需要选择哪个commit?我目前在openwrt trunk上用的会不定时死掉.

— Reply to this email directly or view it on GitHub https://github.com/semigodking/redsocks/issues/7#issuecomment-94171149.

semigodking avatar Apr 18 '15 15:04 semigodking

谢谢.我试试看.

ghostry avatar Apr 19 '15 05:04 ghostry

@semigodking 不好意思又来麻烦你.我该怎么编译到openwrt里边.我修改https://github.com/aa65535/openwrt-redsocks2/blob/master/Makefile 这个文件的PKG_SOURCE_URL为你的git库.编译的时候提示缺少libcrypto.so.1.0.0,libssl.so.1.0.0这两个.但是我在make menuconfig里有勾选openssl.

ghostry avatar Apr 19 '15 06:04 ghostry

请看中文 wiki,我在里面有写简单的编译方法

Semigod King 2015年4月19日 下午2:49于 "ghostry" [email protected]写道:

@semigodking https://github.com/semigodking 不好意思又来麻烦你.我该怎么编译到openwrt里边.我修改 https://github.com/aa65535/openwrt-redsocks2/blob/master/Makefile 这个文件的PKG_SOURCE_URL为你的git库.编译的时候提示缺少libcrypto.so.1.0.0,libssl.so.1.0.0这两个.但是我在make menuconfig里有勾选openssl.

— Reply to this email directly or view it on GitHub https://github.com/semigodking/redsocks/issues/7#issuecomment-94245160.

semigodking avatar Apr 19 '15 06:04 semigodking

@semigodking 谢啦.看起来要加上这种包含绝对路径的参数.这样的话我放弃了.对我来说,定时重启redsocks2可能是比升级他更好的选择.

CFLAGS +=-fPIC -O2
-I ~/openwrt/openwrt/staging_dir/target-mipsel_dsp_uClibc-0.9.33.2/usr/include/
-L ~/openwrt/openwrt/staging_dir/target-mipsel_dsp_uClibc-0.9.33.2/usr/lib/

ghostry avatar Apr 19 '15 07:04 ghostry

这次的升级很重要,建议升级

Semigod King 2015年4月19日 下午3:18于 "ghostry" [email protected]写道:

@semigodking https://github.com/semigodking 谢啦.看起来要加上这种包含绝对路径的参数.这样的话我放弃了.对我来说,定时重启redsocks2可能是比升级他更好的选择.

CFLAGS +=-fPIC -O2
-I ~/openwrt/openwrt/staging_dir/target-mipsel_dsp_uClibc-0.9.33.2/usr/include/
-L ~/openwrt/openwrt/staging_dir/target-mipsel_dsp_uClibc-0.9.33.2/usr/lib/

— Reply to this email directly or view it on GitHub https://github.com/semigodking/redsocks/issues/7#issuecomment-94247813.

semigodking avatar Apr 19 '15 07:04 semigodking

我觉得我搞不定他.

ghostry avatar Apr 19 '15 07:04 ghostry

@ghostry 可参考我的配置https://github.com/wongsyrone/openwrt-1/tree/master/package/external/redsocks2

wongsyrone avatar Apr 19 '15 08:04 wongsyrone

@wongsyrone 谢谢,帮了大忙了.

ghostry avatar Apr 19 '15 13:04 ghostry

我的redsocks2在内存里有两个进程,是不是正常的?使用tcpdns和redudp好像都不大稳定,最后DNS防污染采用的是 dnscrypt-proxy。综合情况,没有使用ipset方案好(就是时不时卡一下,无法顺利地登陆被墙页面),不知道是不是参数没有配好的原因。

wang20150419 avatar Apr 29 '15 03:04 wang20150419

两个进程是正常的。redudp配合 ss工作很稳定啊。我的dnscrypt是偶尔不行,所以我配置 dnsmasq向两个都发请求,用最先得到的回应。你可以考虑一下。

Semigod King 2015年4月29日 上午11:04于 "wang20150419" [email protected]写道:

我的redsocks2在内存里有两个进程,是不是正常的?使用tcpdns和redudp好像都不大稳定,最后DNS防污染采用的是 dnscrypt-proxy。综合情况,没有使用ipset方案好(就是时不时卡一下,无法顺利地登陆被墙页面),不知道是不是参数没有配好的原因。

— Reply to this email directly or view it on GitHub https://github.com/semigodking/redsocks/issues/7#issuecomment-97290587.

semigodking avatar Apr 29 '15 03:04 semigodking

@wang20150419 我用的chinadns除了苹果市场有问题别的都还好。

ghostry avatar Apr 29 '15 03:04 ghostry

我在最新版本中并没有遇到CPU high的问题。不知道@ownhere还有没有遇到这个问题。如果没有的话,我将关闭这个issue.

semigodking avatar May 05 '15 05:05 semigodking

新版未遇到问题

ownhere avatar May 06 '15 23:05 ownhere