yisier / nps

在 0.26.10 版本的基础上修改而来的
https://ehang.io/nps/documents
GNU General Public License v3.0
1.95k stars 245 forks source link

cpu 占用 太高 #63

Open zhouyang8304 opened 1 year ago

zhouyang8304 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Opening '...'
  2. Click on '....'
  3. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots or logs Add screenshots or logs to help explain your problem.

Server (please complete the following information):

Client (please complete the following information):

Additional context Add any other context about the problem here.

yisier commented 1 year ago

client or server ?

Coflys commented 1 year ago

服务器端,占用太高了, image

Coflys commented 1 year ago

刚刚任务管理器忘记截图了,上一个nps截图中的cpu占用,基本上都是nps占用的。 nps服务重启后占用极低
image

yisier commented 1 year ago

压缩、加密、缓存,这些功能都关掉试试看

Coflys commented 1 year ago

我从我重启到现在,占用很低

Coflys commented 1 year ago

我先观察几天看,有消息了,我会在下面更贴

aohanhongzhi commented 1 year ago

我这里还是很高

image
Coflys commented 1 year ago

我今天看到了CPU占用超高,但是nps的负载其实很低很低 image image image image

JsonSong89 commented 11 months ago

这个问题原版就有,不过是npc占用很高 而且有一定偶然性,目前没发现规律

换到这边之后,也出现过一次,每次都是重启就好了

AnonymousAtomNet commented 3 months ago

too, 现在长期是这样的,不知道有没有老板可以帮忙解决一下

aohanhongzhi commented 3 weeks ago

我目前比较明确就是这个nps 时不时CPU占用很高。

image

David-xian66 commented 3 weeks ago

可能是某些代码有不容易被发现的无限循环bug,检查一下?

yisier commented 3 weeks ago

我目前比较明确就是这个nps 时不时CPU占用很高。

image

需要知道是什么场景导致的,使用了什么协议,tcp udp http 还是 https

aohanhongzhi commented 3 weeks ago

我目前比较明确就是这个nps 时不时CPU占用很高。 image

需要知道是什么场景导致的,使用了什么协议,tcp udp http 还是 https

可以,我持续追踪下。目前加上了gops。我目前主要使用的socks5协议。

大概有几百个。在线的也比较多。

image

2024-08-02

CPU占用 180%了

image

下面这个没看出来问题。

image

从上图分析,应该是有大量的锁竞争发生和定时器设计。

堆信息分析 image

image

貌似是

image

2024-08-06

image

pprof.nps.samples.cpu.011.pb.gz

应该是有很强的锁竞争

image