-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[THIN Mode] High CPU Usage and Nodejs Event loop stucked #1700
Comments
Hi @Fiorello , If you have enabled statistics ( Can you also let us know what are the on a separate note:
|
Hi Sudarshan, thanks for your time. The problem was initially found on a production version, compiled with pkg and therefore impossible to inspect. I tried this debug session with different pool configurations: In the cpu profile file, you see only 24 seconds, because i have stopped the profiler, but the process remained blocked for several minutes, without executing any other task node. About statistics, i didn't enabled during that debug session, i will try to enable and i'll come back to you with results. |
Thanks for reproducing it locally. Can you keep a console inside Please see below patch is not a fix..
|
above there is small typo in code , edited it.
|
Can you please remove the line 488 and 489 and modify it like this and try it? if (this._pendingRequests.length > 0 && (this._freeConnectionList.length === 0) && (numToCreate === 0)) { |
I mean you can remove the
|
I have tried with only console.log inside the check. |
Thanks for confirming . I was trying with a test to reach this state but was not successful.
If i can reproduce it locally, I can try out few fixes. If possible can you try below fix with 6.6.0 diff --git a/lib/pool.js b/lib/pool.js
index 566189849..1d7436ed6 100644
--- a/lib/pool.js
+++ b/lib/pool.js
@@ -423,7 +423,7 @@ class Pool extends EventEmitter {
throw err;
}
- if (this._connectionsOut >= poolMax ||
+ while (this._connectionsOut >= poolMax ||
this.status === constants.POOL_STATUS_RECONFIGURING) {
// when the queue is huge, throw error early without waiting for queue |
I was able to replicate some what similar issue but not sure if its the same one you are facing. |
I ran two debugging sessions, one for 30 minutes and one for 20 without problems. |
Thanks @Fiorello for confirmation. We will share details on the patch. |
Thanks to you |
Is it an error or a hang or a crash?
No error thrown by node-oracle but the process become unresponsive.
What error(s) or behavior you are seeing?
The process reach 100% of CPU usage and no more operation is executed.
We recently upgrade node-oracle to version 6.6.0.
Thin driver is awesome, uses less memory and less cpu than thick.
But after a day or two(random) the process stop to execute operations, the web server stop to receive request and also the background tasks are not executed anymore.
So i have started a debug session with chrome performance tool, i have taken a screenshot(attached)
What i see is that, the process is stuck inside a while loop of the bgThreadFunction in lib/thin/pool.js
At the moment, we have switched to Thick driver and it works, but i'd like to use Thin version of course.
Does anybody have similar problems?
CPU-20241017T222332.cpuprofile
The text was updated successfully, but these errors were encountered: