我想为高吞吐量应用程序选择一个连接池

发布于 2024-12-29 12:47:15 字数 574 浏览 3 评论 0原文

我现在使用 C3P0 连接池,但行为不稳定。我在各种环境中进行测试并改进数据库选项。今天发现Tomcat 7 jdbc连接池释放了,搞定了。有人使用它并获得比 C3p0 更好的性能吗? (我还测试了boncp连接池)
我的应用程序负载非常高。我的问题是:

  1. 一个小时后连接池抛出“无法打开连接”异常。
  2. 有时我会收到此异常“尝试使用已关闭或损坏的资源”池,并且在重新启动我的连接池(通过其 mbean)时问题已修复
    我的C3P0参数是:

    初始池大小 = 1
    minPoolSize=1
    最大池大小 = 50
    最大空闲时间 = 20000
    debugUnreturnedConnectionStackTraces = true
    财产周期=60
    acquireRetryDelay =1000
    最大连接年龄=0
    结账超时=5000
    获取增量=1
    帮助线程数 =5
    获取重试尝试 =1
    未返回的连接超时=90
    BreakAfterAcquireFailure = false
    我还用几个值测试了这个参数,但没有看到任何明显的变化。

I used C3P0 connection pool to now but get not stable behavior. I test in various kinds of environments and improvement database options. I found today Tomcat 7 jdbc connection pool released and get it. Do anyone use it and get better performance than C3p0?
(I also test boncp connection pool)
My application is very high load. My problems are:

  1. after pass a hour connection pool throws "Can't Open Connection" exception.
  2. sometimes I get this exception "Attempted to use a closed or broken resource" pool and when restart my connection pool(by its mbean) problem fixed
    My C3P0 parameters are:

    initialPoolSize = 1
    minPoolSize=1
    maxPoolSize = 50
    maxIdleTime = 20000
    debugUnreturnedConnectionStackTraces = true
    propertyCycle =60
    acquireRetryDelay =1000
    maxConnectionAge =0
    checkoutTimeout =5000
    acquireIncrement =1
    numHelperThreads =5
    acquireRetryAttempts =1
    unreturnedConnectionTimeout =90
    breakAfterAcquireFailure =false
    I also test this parameters with several value but don't see any perceptible changes.

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

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

发布评论

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

评论(1

む无字情书 2025-01-05 12:47:15

我还没有尝试过 Tomcat 池,但很快就会研究一下。您可能可以做的是调整您的 c3p0 池以进行优化。这将根据应用程序的实际负载而有所不同,但与其他池技术相比,我发现 c3p0 非常灵活。
如果您能在这里详细说明您的问题,并提及您正在使用的池参数,那就太好了。

I haven't tried the tomcat pool yet, but will look into this soon. What you can probably do is tweak your c3p0 pool for optimization. This will vary according to the actual load over your application, but as compared to other pooling technologies, I've found c3p0 to be flexible.
It would be nice if you could elaborate your problem here, and mention the pooling parameters you are using.

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