orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Reached maximum number of concurrent connections with single script

Open johny65 opened this issue 3 years ago • 5 comments

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).

johny65 avatar Jun 15 '21 13:06 johny65

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.

johny65 avatar Aug 13 '21 16:08 johny65

Hi,

Some improvement have been done on the script pool logic in recent releases, do you still experience this problem ?

Regards

tglman avatar Mar 08 '23 13:03 tglman

Hi, testing with 3.2.17 the problem is still present.

johny65 avatar Mar 22 '23 15:03 johny65

Hi @johny65 ,

This sound strange do you have a minimal script that can reproduce the case ?

Regards

tglman avatar Mar 23 '23 14:03 tglman

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.

9625.txt

johny65 avatar Feb 21 '24 15:02 johny65