orientdb
orientdb copied to clipboard
Reached maximum number of concurrent connections with single script
OrientDB Version: 3.2.0
Java Version: openjdk version "11.0.11"
OS: Ubuntu 21.04
Expected behavior
To run a batch script with lot of inserts or updates without consuming all available connections.
Actual behavior
When running a batch script through the console, it seems like each insert or update is consuming one "connection", so the limit is reached and no new connections can be made (although the script is still executing fine). The server logs Reached maximum number of concurrent connections (max=1000, current=213837), reject incoming connection from /127.0.0.1:52756 [OServerNetworkListener]
.
Steps to reproduce
I can reproduce it with a fresh install of 3.2.0. Unzip zip and start server.
Create a script with thousand lines like this: create vertex V set num = 1; ...
In console:
orientdb> connect remote:localhost/demodb admin admin;
Connecting to database [remote:localhost/demodb] with user 'admin'...OK
orientdb {db=demodb}> load script script.sql;
Try to connect to server (i.e. opening Studio) while the script is executing, the connection is rejected and logs:
Reached maximum number of concurrent connections (max=1000, current=3779), reject incoming connection from /127.0.0.1:57932 [OServerNetworkListener]
("current" is an increasing number).
If the same script as previous "Steps to reproduce" example is executed from Java, then the problem of concurrent connections doesn't exist:
String content = Files.readString(Path.of("script.sql"));
try (var db = opool.acquire()) {
db.execute("sql", sql);
}
So the problem is when using load script
from Console.
Hi,
Some improvement have been done on the script pool logic in recent releases, do you still experience this problem ?
Regards
Hi, testing with 3.2.17 the problem is still present.
Hi @johny65 ,
This sound strange do you have a minimal script that can reproduce the case ?
Regards
Hi, I tested this again with version 3.2.27 and the problem is still present. I attach a minimal script to reproduce the case. While the script is running (load it though the console, i.e. in interactive shell with console.sh), log in to the database in Studio and log out and try to log in again.