高性能计算Oracle Connections = 灾难的根源?

发布于 2024-12-11 08:18:18 字数 1396 浏览 0 评论 0原文

我正在 HPC(高性能计算)集群上运行 Java 应用程序。该应用程序与 Oracle 11.2.0 数据库建立 JDBC 瘦连接。鉴于这是在集群上,因此会同时建立和维护大量连接(尽管与数据库的实际交互相对较少)。潜在的最大并发连接数将为 4500(尽管永远不会达到那么高)。

应用程序工作正常,直到大约第 125 个并行连接时失败并出现以下错误。此错误消息在后续连接尝试中仍然存在:

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)

我是否正确地认为这与数据库允许的连接数限制有关?或者这与数据库的负载有关?

有谁知道我如何解决这个问题,以便我能够并行建立更多数量的连接?

非常感谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

信仰 2024-12-18 08:18:18

可能只是你的连接池,如果你使用一个,我希望 Oracle 能够处理远远超过 125 个的连接池。即,你选择的方法有一个 125 的人为上限,很可能是默认情况,而不是你自己强加的。

您是否使用 Spring 之类的东西来管理您的连接,例如通过 Apache Commons DBCP 库?

另外,您是否实际上始终拥有/需要 4500 个连接,或者您是否有 4500 个线程,每个线程都需要突发的数据库连接?如果是后者,例如 500 个连接池可能就足够了。

编辑:当然,这可能是 Oracle 配置对您造成影响;看看这个早期的问题:

如何查看Oracle数据库允许的最大连接数?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文