#1 2013-12-05 07:06:31

tristan
Member
Registered: 2013-11-14

Problem with connection timeouts

Every morning, the first users on our ReportServer get the following errors when trying to run a report:

Dec 05, 2013 8:31:40 AM net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl execute
WARNING: Could not open connection to: jdbc:mysql://192.168.20.4/rc_db with user: reporter. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,198,801 milliseconds ago.  The last packet sent successfully to the server was 63,
net.datenwerke.rs.core.service.reportmanager.exceptions.DatabaseConnectionException: Could not open connection to: jdbc:mysql://192.168.20.4/rc_db with user: reporter. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 63,198,801 milliseconds ago.  The last packet sent successfully to the server was 63,.......


The "wait_time" on our MySQL server is the default 28800 seconds (8 hours).

My "datasources/pool.cf" file is the default one provided in the config guide. i.e.

<?xml version=“1.0“ encoding=“UTF-8“?>
<configuration>
  <pool disable=“false“ provider=“c3p0“>
    <defaultconfig>
      <partitionCount>4</partitionCount>
      <maxConnectionsPerPartition>10</maxConnectionsPerPartition>
      <minConnectionsPerPartition>1</minConnectionsPerPartition>
      <connectionTimeoutInMs>10000</connectionTimeoutInMs>
      <maxConnectionAgeInMs>3600000</maxConnectionAgeInMs>
      <queryExecutionTimeLimitInMs>60000</queryExecutionTimeLimitInMs>
      <acquireRetryDelayInMs>1000</acquireRetryDelayInMs>
      <acquireRetryAttempts>2</acquireRetryAttempts>
      <idleMaxAgeInSeconds>3600</idleMaxAgeInSeconds>
      <idleConnectionTestPeriodInSeconds>14400</idleConnectionTestPeriodInSeconds>
    </defaultconfig>
  </pool>
</configuration>

The idleConnectionTestPeriodInSeconds is set to 14400 seconds (4 hours) which is half the wait_timeout in on my database.
Am I misunderstanding these settings? Is there a way to prevent the CommunicationException from occurring using any of the settings in pool.cf?

Thanks

Offline

#2 2013-12-09 12:05:38

Thorsten J. Krause
Guest

Re: Problem with connection timeouts

Hi Tristan,

we had an old version of the pool configuration in the appendix of the config guide.
Try this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <pool>
      <defaultconfig>
         <maxPoolSize>40</maxPoolSize>
         <initialPoolSize>10</initialPoolSize>
         <acquireRetryAttempts>10</acquireRetryAttempts>
         <acquireRetryDelay>500</acquireRetryDelay>
         <checkoutTimeout>60000</checkoutTimeout>
         <maxConnectionAge>7200</maxConnectionAge>
         <maxIdleTime>3600</maxIdleTime>
      </defaultconfig>
   </pool>
</configuration>

Cheers,
Thorsten

#3 2013-12-17 10:05:32

tristan
Member
Registered: 2013-11-14

Re: Problem with connection timeouts

Hi Thorsten,

The revised config works perfectly. Thanks for the help.

Regards,

Tristan

Offline

Board footer

Powered by FluxBB