无法填充池(没有可用的缓冲区空间) [英] Unable to fill pool (no buffer space available)

查看:650
本文介绍了无法填充池(没有可用的缓冲区空间)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Wildfly 8.2并在打开某个网页时触发一系列数据库请求。所有查询都通过JPA Criteria API调用,并按预期返回结果 - 并且 - 它们中没有一个提供警告,错误或异常。这一切都运行在并行Plesk。



现在,我注意到在2到3天内出现以下错误,站点变得无响应。我重新开始,我又等了大约3天,直到它再次发生(取决于我的要求数量)。



我检查了我的Linux服务器上的tcpsndbuf,并且发现它始终处于最大值。除非我重新启动Wildfly。显然它无法释放连接。

解决方案

尝试添加此Hibernate属性:

 < ; property name =hibernate.connection.release_mode> after_transaction< / property> 

默认情况下,

I'm using Wildfly 8.2 and fire a series of DB requests when a certain web page is opened. All queries are invoked thru JPA Criteria API, return results as expected - and - none of them delivers a warning, error or exception. It all runs in Parallel Plesk.

Now, I noticed that within 2 to 3 days the following error appears and the site becomes unresponsive. I restart and I wait approx another 3 days till it happens again (depending on the number of requests I have).

I checked the tcpsndbuf on my linux server and I noticed it is constantly at max. Unless I restart Wildfly. Apparently it fails to release the connections.

The connections are managed by JPA/Hibernate and the Wildfly container. I don't do any special or custom transaction handling e.g. open, close. etc. I leave it all to Wildfly.

The MySQL Driver I'm using is 5.1.21 (mysql-connector-java-5.1.21-bin.jar)

In the standalone.xml I have defined the following datasource datasource values (among others):

<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
    <min-pool-size>3</min-pool-size>
    <max-pool-size>10</max-pool-size>
</pool>
<statement>
     <prepared-statement-cache-size>32</prepared-statement-cache-size>
     <shared-prepared-statements>true</shared-prepared-statements>
</statement

Has anyone experience the same rise of tcpsndbuf values (or this error)? In case you require more config or log files, let me know. Thanks!


UPDATE Despite the following additional timeout settings, it still runs into the hanger. And thus, it will then use 100% CPU time, whenever the max tcpsndbuf is reached.,

解决方案

Try adding this Hibernate property:

<property name="hibernate.connection.release_mode">after_transaction</property>

By default, JTA mandates that connection should be released after each statement, which is undesirable for most use cases. Most Drivers don't allow multiplexing a connection over multiple XA transactions anyway.

这篇关于无法填充池(没有可用的缓冲区空间)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆