-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
190% CPU hike on v2.2.4 #1556
Comments
Do you have a CPU profile that could show where CPU time is being spent? You can use something like 0x to generate a flame graph, if you don't instrument your application with some APM solution. Ideally with a comparison to 2.2.3 |
Hello @Nevon, on the latest kafkajs version it seems to be coming from the scheduleCheckPendingRequest. I noticed that there was a change related to this in the requestQueue/index.js in the latest release. Let me know if you need more details. This is v2.2.3. You can see there is a huge jump in the cpu usage between v2.2.4 and this one. |
Thank you, that's what I suspected, but it's great to have some data to back it up. For reference, the change was introduced in #1532. |
Also noticed this CPU increase in my app. |
We also have this issue after upgrading from kafkajs 1 -> latest. All services that have upgraded consume way more cpu and event loop iterations per second have increased 100X. After applying @MDSLKTR's fix as a patch this issue goes away. Would like to see this get merged asap. Thank you @MDSLKTR ! |
* fix regression when timeout is marginal See tulios#1556 fixes * always use the calculated scheduled timeout or 0 --------- Co-authored-by: MDSLKTR <[email protected]>
Also noticed this CPU increase in our app. Using roughly 1.5/2x more CPU than previously |
We have been using kafka-node for very long time, and decided to move to kafkajs for publishing to start with. |
Describe the bug
When upgrading to v2.2.4 we saw a 190% increase in our CPU usage.
To Reproduce
Not sure how you can reproduce it. We do however send thousand of messages per second.
If none of the above are possible to provide, please write down the exact steps to reproduce the behavior:
Expected behavior
No cpu usage hike between v2.2.3 and v.2.2.4
Observed behavior
A clear and concise description of what did happen. Please include any relevant logs with the log level set to debug.
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: