I am running a Java application on a HPC (High Performance Computing) cluster. The application makes a JDBC thin connection through to an Oracle 11.2.0 database. Given that this is on a cluster, a high number of connections are made and maintained concurrently (though the actual interactions with the database are relatively minimal). The potential maximum number of concurrent connections will be 4500 (though it will never reach that high).
The application works fine until around the 125th parallel connection where it fails with the following error. This error message persists for subsequent connection attempts:
java.sql.SQLException: No more data to read from socket
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:209)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1129)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1080)
at oracle.jdbc.driver.T4C8TTIpro.receive(T4C8TTIpro.java:131)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:902)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:269)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:454)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:802)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
Am I right in thinking this has something to do with a limit on the number of connections allowed to the database? Or is this associated with the load on the database?
Does anyone have an idea about how I may resolve this so that I am able to make a higher number of connections in parallel?
Many thanks in advance.
Could just be your connection pool, if you’re using one, I’d expect Oracle to handle much more than 125. I.e. your chosen approach has an artificial cap of 125, most likely by default than by your own imposition.
Are you using something like Spring to manage your connections, e.g. via Apache Commons DBCP libraries?
Also, do you actually have/need 4500 connections all the time, or do you have 4500 threads each of which needs bursts of DB connectivity? If the latter a connection pool of, say, 500 might suffice.
Edit: of course it could be an Oracle config that’s hitting you; check out this earlier SO question:
How to check the maximum number of allowed connections to an Oracle database?