You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Running queries ocassionally causes ArcadeDB to get stuck at 100% CPU usage #846
Sometimes when I run a cypher query or perhaps just connect / disconnect from the database, the CPU usage increases to 100% and gets stuck there. It stays at 100% even when I am not running any queries.
I don't know what causes it to happen as sometimes I can do a lot of queries without this happening, and sometimes after the first few seconds of queries it gets stuck.
My guess would be that there is something accidentally jumps into a 'busy wait' mode where it gets stuck checking something in an infinite for loop. Would be really nice to have a fix for this.
changed the title [-]Running queries ocassionally causes 100% CPU usage[/-][+]Running queries ocassionally causes ArcadeDB to get stuck at 100% CPU usage[/+]on Feb 8, 2023
I'm not using any special setting (as far as I know), just running server.bat. So I just tested about half an hour of production usage, and it did not seem to happen. However, I think I closed it during a running transaction and it shot up to 70% and got stuck there.
Could it be happening when connections are closed during running transactions or something like that?
This was never found in production, AFAIK, so it could be the Postgres plugin. Is there any chance you can do a dump of the JVM when that happens? You can execute a jstack <pid>.
Also just a note, now that (I think) it's happening only between connections, it's not super high priority for me as my use is based only on a single connection. Though I leave this prioritisation up to you.
Thanks for the dump! The issue seems to be in the postgres threads:
"ArcadeDB-postgres//0:0:0:0:0:0:0:1" #56 prio=5 os_prio=0 cpu=189828.13ms elapsed=239.99s tid=0x000002832c484000 nid=0x5d5c runnable [0x000000e2f3fff000]
java.lang.Thread.State: RUNNABLE
at java.lang.Throwable.fillInStackTrace(java.base@11.0.14.1/Native Method)
at java.lang.Throwable.fillInStackTrace(java.base@11.0.14.1/Throwable.java:787)
- locked <0x0000000722b90c40> (a java.io.EOFException)
at java.lang.Throwable.<init>(java.base@11.0.14.1/Throwable.java:255)
at java.lang.Exception.<init>(java.base@11.0.14.1/Exception.java:54)
at java.io.IOException.<init>(java.base@11.0.14.1/IOException.java:47)
at java.io.EOFException.<init>(java.base@11.0.14.1/EOFException.java:50)
at java.io.DataInputStream.readUnsignedByte(java.base@11.0.14.1/DataInputStream.java:295)
at com.arcadedb.network.binary.ChannelBinary.readUnsignedByte(ChannelBinary.java:87)
at com.arcadedb.postgres.PostgresNetworkExecutor.readNextByte(PostgresNetworkExecutor.java:994)
at com.arcadedb.postgres.PostgresNetworkExecutor.readMessage(PostgresNetworkExecutor.java:953)
at com.arcadedb.postgres.PostgresNetworkExecutor.run(PostgresNetworkExecutor.java:140)
The reading from the TCP/IP socket causes tons of exceptions. Checking on it.
Do you have any idea why a client is opening so many connections to the server?
2023-02-08 22:20:22.415 SEVER [PostgresNetworkExecutor] Closing connection with client
2023-02-08 22:20:22.418 SEVER [PostgresNetworkExecutor] Closing connection with client
2023-02-08 22:20:22.425 SEVER [PostgresNetworkExecutor] Closing connection with client
2023-02-08 22:20:22.426 SEVER [PostgresNetworkExecutor] Closing connection with client
2023-02-08 22:20:22.427 SEVER [PostgresNetworkExecutor] Closing connection with client
Ok, thanks to your files I was able to understand the issue (almost sure). The EOFException from the socket was not managed properly. Please let me know if you see this happening again. Thanks again for the detailed report!
I noticed this too as I started to play with arcadedb 23.10.1 yesterday sporadically with python postgres drivers. This is just a heads up and I will provide the dump here next time it happens. Please also let us know whether we should run it in debug mode (and detailed instruction to make it reproducible if applicable).
BTW, setting
-XX:ActiveProcessorCount=1
with OpenJDK 64-Bit Server VM 11.0.10 (Zulu11.45+27-CA) didn't help. for this scenario. I also noticed that there doesn't seem to be a more graceful shutdown instruction except interrupting the batch file with Ctrl-C or otherwise kill the Java process.
Ok, thanks to your files I was able to understand the issue (almost sure). The EOFException from the socket was not managed properly. Please let me know if you see this happening again. Thanks again for the detailed report!
Activity
[-]Running queries ocassionally causes 100% CPU usage[/-][+]Running queries ocassionally causes ArcadeDB to get stuck at 100% CPU usage[/+]lvca commentedon Feb 8, 2023
Are you using the setting
-Darcadedb.profile=high-performanceor-Darcadedb.asyncOperationsQueueImpl=fast?lvca commentedon Feb 8, 2023
Or are you running o Docker? We have another issue about that.
shasaur commentedon Feb 8, 2023
I'm not using any special setting (as far as I know), just running
server.bat. So I just tested about half an hour of production usage, and it did not seem to happen. However, I think I closed it during a running transaction and it shot up to 70% and got stuck there.Could it be happening when connections are closed during running transactions or something like that?
shasaur commentedon Feb 8, 2023
Oh actually, the only thing is that I'm using the Postgres plug-in. And no, I'm not using Docker.
lvca commentedon Feb 8, 2023
This was never found in production, AFAIK, so it could be the Postgres plugin. Is there any chance you can do a dump of the JVM when that happens? You can execute a
jstack <pid>.shasaur commentedon Feb 8, 2023
Done! Here's the JVM dump and also the console output of the DB.
shasaur commentedon Feb 8, 2023
Also just a note, now that (I think) it's happening only between connections, it's not super high priority for me as my use is based only on a single connection. Though I leave this prioritisation up to you.
lvca commentedon Feb 9, 2023
Thanks for the dump! The issue seems to be in the postgres threads:
The reading from the TCP/IP socket causes tons of exceptions. Checking on it.
lvca commentedon Feb 9, 2023
Do you have any idea why a client is opening so many connections to the server?
fix: postgres plugin caused 100% spike of CPU
lvca commentedon Feb 9, 2023
Ok, thanks to your files I was able to understand the issue (almost sure). The EOFException from the socket was not managed properly. Please let me know if you see this happening again. Thanks again for the detailed report!
shasaur commentedon Feb 9, 2023
Okay great! Nice to see it fixed so quickly. This will help a lot when I run tests as I open a lot of connections then.
LLuke commentedon Nov 17, 2023
I noticed this too as I started to play with arcadedb 23.10.1 yesterday sporadically with python postgres drivers. This is just a heads up and I will provide the dump here next time it happens. Please also let us know whether we should run it in debug mode (and detailed instruction to make it reproducible if applicable).
BTW, setting
-XX:ActiveProcessorCount=1with OpenJDK 64-Bit Server VM 11.0.10 (Zulu11.45+27-CA) didn't help. for this scenario. I also noticed that there doesn't seem to be a more graceful shutdown instruction except interrupting the batch file with Ctrl-C or otherwise kill the Java process.
lvca commentedon Nov 17, 2023
@LLuke it would be awesome if you could produce a stack trace ;-)
chore(studio-deps-dev)(deps-dev): bump semver from 7.7.4 to 7.8.0 in …
fix: postgres plugin caused 100% spike of CPU
chore(studio-deps-dev)(deps-dev): bump semver from 7.7.4 to 7.8.0 in …