10

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). enter image description here

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. enter image description here

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.enter image description here, enter image description here

feder
  • 1,849
  • 2
  • 25
  • 43

2 Answers2

5

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.

Vlad Mihalcea
  • 142,745
  • 71
  • 566
  • 911
  • Nope. It did not help. It grows with the same ways. I also replaced the mysql driver - without success. – feder Sep 20 '15 at 17:30
3

Do you use openvz? I think this question should be asked on serverfault. It is related to linux configuration. You can read: tcpsndbuf. You should count opened sockets and check condition: UBC consistency check

sibnick
  • 3,995
  • 20
  • 20
  • No. I used Paralles Power Panel. Nothing helped. Neither the hibernate release_mode nor mysql driver update worked. – feder Sep 20 '15 at 17:29
  • Parallels Power Panel is web-based tool for management openvz containers – sibnick Sep 21 '15 at 03:01