Closed ygao9999 closed 3 years ago
没有测试环境,你能否帮助查看一下各线程的调用栈,看是哪里在空转?
不知如何操作,给出指令,我可以试一下。
在https://gitter.im/ShadowsocksR-Live/Lobby 联系你,可好?
哪里联系都一样。就是用 gdb 命令将软件加载进调试器,运行过程中停下来,看看每个线程的调用栈。这要会 gdb 调试器基本操作。 gdb 启动命令如下格式
gdb --args /usr/bin/ssr-client -c /etc/ssr-native/config.json
Command name abbreviations are allowed if unambiguous. (gdb) run Starting program: /usr/bin/ssr-client -c /etc/ssr-native/config.json [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". ssr-client 2021/01/15 10:56 info ShadowsocksR native client
ssr-client 2021/01/15 10:56 info remote server appl**:443
ssr-client 2021/01/15 10:56 info method aes-128-ctr
ssr-client 2021/01/15 10:56 info password bb**
ssr-client 2021/01/15 10:56 info protocol origin
ssr-client 2021/01/15 10:56 info obfs plain
ssr-client 2021/01/15 10:56 info
ssr-client 2021/01/15 10:56 warn over TLS yes
ssr-client 2021/01/15 10:56 info over TLS domain
ssr-client 2021/01/15 10:56 info over TLS path
ssr-client 2021/01/15 10:56 info
ssr-client 2021/01/15 10:56 info udp relay yes
[New Thread 0xb6d77460 (LWP 3940)] [New Thread 0xb6576460 (LWP 3941)] [New Thread 0xb5d75460 (LWP 3942)] [New Thread 0xb5574460 (LWP 3943)] ssr-client 2021/01/15 10:56 info listening on 0.0.0.0:1080
许久没用 gdb,基本命令我都忘了,你找个教程看看吧。然后再报告。
pi@raspberrypi:~ $ ps aux |grep ssr pi 4171 82.4 0.0 38344 2712 ? Rsl 11:11 11:56 /usr/bin/ssr-client -d -c /etc/ssr-native/config.json pi 4216 0.0 0.0 7796 536 pts/1 S+ 11:26 0:00 grep --color=auto ssr pi@raspberrypi:~ $ gdb GNU gdb (Raspbian 8.2.1-2) 8.2.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "arm-linux-gnueabihf". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) attach 4171
Attaching to process 4171
[New LWP 4172]
[New LWP 4173]
[New LWP 4174]
[New LWP 4175]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
0xb6e1d9d0 in epoll_wait (epfd=
(More stack frames follow...) (gdb)
(gdb) thread 1 [Switching to thread 1 (Thread 0xb6fc8010 (LWP 4171))]
30 in ../sysdeps/unix/sysv/linux/epoll_wait.c (gdb) bt
卧槽!难道是 libuv 的问题? “树莓派4 官方系统32位” 是哪个 Linux 发行版?
树莓派4 官方系统32位
Raspbian
我这里在Windows下工作时占13%CPU,你观察多点时间看情况啥样。
杀掉ssr cpu是1, 运行ssr-client是30%,工作时31%,没有明显变化。
我也没头绪了,我去看看 libuv 社区……
找到原因了。稍后修复。
搞完。你测试一把?
牛逼了,问题解决。
Debian / Ubuntu
sudo su # using root account
sudo apt-get update -y sudo apt-get upgrade -y sudo apt-get install --no-install-recommends build-essential autoconf libtool asciidoc xmlto -y sudo apt-get install git gcc g++ gdb cmake automake -y sudo apt-get -f install -y
cd / # switch to root directory
git clone https://github.com/ShadowsocksR-Live/shadowsocksr-native.git mv shadowsocksr-native ssr-n # rename shadowsocksr-native to ssr-n cd ssr-n # enter ssr-n directory. git submodule update --init git submodule foreach -q 'git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo master)'
build ShadowsocksR-native
mkdir build && cd build cmake .. && make
make install
/bin/cp -rfa src/ssr-* /usr/bin
树莓派4 官方系统32位 未有代理连接时,树莓派4客户端 cpu 一直在30%