SkyAPM / SkyAPM-nodejs

The NodeJS server side agent for Apache SkyWalking
Apache License 2.0
128 stars 86 forks source link

High cpu and out of memory in production #72

Open zouyx opened 5 years ago

zouyx commented 5 years ago

there was high cpu usage , and high latency. but it was turn to normal when i shut down apm.

infomation: node client version:v1.0 thinkjs version:2.2

cpu idle: image

wu-sheng commented 5 years ago

What do you mean shutdown apm? Backend or agent?

And when do you shutdown? 7-10?

zouyx commented 5 years ago

shutdown agent.

first release at 3.14 21:00. and restart twice. first restart at 3.15 10:00, but i haven't realized the root cause. second time at 3.16 14:00, at the same time shutdown agent.

wu-sheng commented 5 years ago

But, after 3.16 1400, the cpu is still high. You said the agent shutdown.

zouyx commented 5 years ago

no , this is idle time

wu-sheng commented 5 years ago

I see. How many throughputs of your application?

zouyx commented 5 years ago

this app is avg 1 qps

zouyx commented 5 years ago

image

Flame graph in v1.0

zouyx commented 5 years ago

image

Flame graph in v1.1

ascrutae commented 5 years ago

It seems like the CPU usage rate of V1.1 is better than V1.0's. I saw that the serialized object of GRPC Node.js costs lots of CPU time in V1.0, and I will investigate this problem.

wu-sheng commented 5 years ago

If the QPS is just 1, why does gRPC run in such high frequency? What is your strategy of activating gRPC? @ascrutae

ZhouBox commented 5 years ago

I had the same problem, so I temporarily removed the AMP part.

zouyx commented 5 years ago

@ZhouBox which version did you used?

ZhouBox commented 5 years ago

@zouyx 0.1.5

zouyx commented 5 years ago

SkyAPM-nodejs 0.1.5?

i fixed this problem in 1.1.0, you can try it out

ZhouBox commented 5 years ago

@zouyx sorry, I use skyapm-egg-require 0.1.5, SkyAPM-nodejs use 1.1.2.

zouyx commented 5 years ago

Ref #71

wuliupo commented 4 years ago

+1

zouyx commented 4 years ago

@wuliupo i think this is new version for js as below

https://github.com/apache/skywalking-client-js

wu-sheng commented 4 years ago

@zouyx No, it isn't. That is for browser specific.