【问题标题】:how to reduce the getConnection time consume in Atomikos如何减少 Atomikos 中的 getConnection 时间消耗
【发布时间】:2020-10-21 14:23:55
【问题描述】:

我正在为 Oracle 使用 Atomkios XA 配置。

这是我创建数据源连接的代码。

    OracleXADataSource oracleXADataSource = new OracleXADataSource();
    oracleXADataSource.setURL(sourceURL);
    oracleXADataSource.setUser(UN);
    oracleXADataSource.setPassword(PS);

    AtomikosDataSourceBean sourceBean= new AtomikosDataSourceBean();
    sourceBean.setXaDataSource(oracleXADataSource);
    sourceBean.setUniqueResourceName(resourceName);
    sourceBean.setMaxPoolSize(max-pool-size);   // 10 


atomikos:
      datasource:
        resourceName: insight
        max-pool-size: 10
        min-pool-size: 3
    transaction-manager-id: insight-services-tm

这是我的配置,适合大约 5000 个请求的中等用户负载。

但是当用户数量增加假设超过 10000 个请求时,这个类 com.atomikos.jdbc.AbstractDataSourceBean:getConnection 消耗的比正常多。

这节课大约需要 1500 毫秒,但正常时间不到 10 毫秒。我可以理解用户需求的增加,getConnection 将等待状态以从连接池中选择空闲连接,因此如果我增加我的最大池大小,我的问题是否会解决或任何其他选项功能可用于解决我的问题。

【问题讨论】:

    标签: spring-data-jpa jta xa atomikos


    【解决方案1】:

    尝试在您的数据源上设置 concurrentConnectionValidation=true。

    如果这没有帮助,请考虑免费试用商业 Atomikos 产品:

    https://www.atomikos.com/Main/ExtremeTransactionsFreeTrial

    最好的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-04
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多