1

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.

1 Answers1

0

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?

Community
  • 1
  • 1
Brian
  • 6,391
  • 3
  • 33
  • 49
  • I'm not using a connection pool at the moment. Given that I am executing in parallel, do you know how I would go about creating one that each application can access? – user1007128 Oct 21 '11 at 13:22
  • Actually I'm not sure how you would share one between *applications*. By applications do you definitely mean distinct apps rather than distinct threads within one app...? – Brian Oct 21 '11 at 13:43
  • Yes, the application is being run on multiple cluster nodes. They are essentially distinct instances of the same application. – user1007128 Oct 21 '11 at 13:55
  • OK; first off I would look at whether you can simply get Oracle to support the number of connections you need directly, that's the simplest architecture option. I edited my answer to point you at a relevent earlier post (not mine, I must add). If that proves un achievable you might need to implement some sort of DB connection broker which sits between your apps and the DB, however that's a pretty big step and introduces some pretty significant challenges of its own. – Brian Oct 21 '11 at 14:10
  • Turns out the maximum number of processes was being hit. Since upped this and all has been well. – user1007128 Oct 25 '11 at 15:02