You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Mikael Kurula <al...@gmail.com> on 2012/12/13 00:35:36 UTC

MySQL timeouts?

Dear All,

As an ordinary user of OpenMeetings, I'm using OpenJPA for persistence. I
have an issue with MySQL timing out. I posted a bug report in the
OpenMeetings JIRA, but I was directed to OpenJPA instead. I sometimes get
messages of the following type in my OpenMeetings log, mainly in the
morning when nobody has used the server overnight; notice the extremely
long time since the last successful transmission:

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The
last packet successfully received from the server was 90,881,924
milliseconds ago. The last packet sent successfully to the server was
90,881,924 milliseconds ago. is longer than the server configured value of
'wait_timeout'. You should consider either expiring and/or testing
connection validity before use in your application, increasing the server
configured values for client timeouts, or using the Connector/J connection
property 'autoReconnect=true' to avoid this problem.

>From what I understood, autoReconnect=true is already in use. Has anyone
here seen anything like this?

My version of openmeetings is this:
apache-openmeetings-incubating-2.0.0.r1361497-14-07-2012_1108.tar.gz

... and the version of the J connector is
mysql-connector-java-5.1.22.tar.gz.

I don't know how to check which version of OpenJPA I'm using, but my
persistence.xml is attached below.

Thanks a lot for any help,
Mikael

--- 8< ---

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.

-->
<!-- persistence.xml schema -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0">
 <persistence-unit name="openmeetings" transaction-type="RESOURCE_LOCAL">

<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
 <class>org.openmeetings.app.persistence.beans.adresses.Adresses</class>
<class>org.openmeetings.app.persistence.beans.adresses.States</class>
 <class>org.openmeetings.app.persistence.beans.basic.Configuration</class>
<class>org.openmeetings.app.persistence.beans.basic.ErrorType</class>
 <class>org.openmeetings.app.persistence.beans.basic.ErrorValues</class>
<class>org.openmeetings.app.persistence.beans.basic.LdapConfig</class>
 <class>org.openmeetings.app.persistence.beans.basic.Naviglobal</class>
<class>org.openmeetings.app.persistence.beans.basic.Navimain</class>
 <class>org.openmeetings.app.persistence.beans.basic.OmTimeZone</class>
<class>org.openmeetings.app.persistence.beans.basic.Sessiondata</class>
 <class>org.openmeetings.app.persistence.beans.basic.SOAPLogin</class>
<class>org.openmeetings.app.persistence.beans.calendar.Appointment</class>

<class>org.openmeetings.app.persistence.beans.calendar.AppointmentCategory</class>
<class>org.openmeetings.app.persistence.beans.calendar.AppointmentReminderTyps</class>

<class>org.openmeetings.app.persistence.beans.calendar.MeetingMember</class>
<class>org.openmeetings.app.persistence.beans.domain.Organisation</class>

<class>org.openmeetings.app.persistence.beans.domain.Organisation_Users</class>
<class>org.openmeetings.app.persistence.beans.flvrecord.FlvRecording</class>

<class>org.openmeetings.app.persistence.beans.flvrecord.FlvRecordingLog</class>
<class>org.openmeetings.app.persistence.beans.flvrecord.FlvRecordingMetaData</class>

<class>org.openmeetings.app.persistence.beans.flvrecord.FlvRecordingMetaDelta</class>
<class>org.openmeetings.app.persistence.beans.invitation.Invitations</class>
 <class>org.openmeetings.app.persistence.beans.lang.FieldLanguage</class>
<class>org.openmeetings.app.persistence.beans.lang.Fieldlanguagesvalues</class>
 <class>org.openmeetings.app.persistence.beans.lang.Fieldvalues</class>
<class>org.openmeetings.app.persistence.beans.logs.ConferenceLog</class>

<class>org.openmeetings.app.persistence.beans.logs.ConferenceLogType</class>
<class>org.openmeetings.app.persistence.beans.poll.PollType</class>
 <class>org.openmeetings.app.persistence.beans.poll.RoomPoll</class>
<class>org.openmeetings.app.persistence.beans.poll.RoomPollAnswers</class>
 <class>org.openmeetings.app.persistence.beans.rooms.RoomModerators</class>
<class>org.openmeetings.app.persistence.beans.rooms.Rooms</class>
 <class>org.openmeetings.app.persistence.beans.rooms.RoomTypes</class>
<class>org.openmeetings.app.persistence.beans.rooms.Rooms_Organisation</class>

<class>org.openmeetings.app.persistence.beans.sip.OpenXGReturnObject</class>
<class>org.openmeetings.app.persistence.beans.user.PrivateMessages</class>

<class>org.openmeetings.app.persistence.beans.user.PrivateMessageFolder</class>
<class>org.openmeetings.app.persistence.beans.user.Salutations</class>
 <class>org.openmeetings.app.persistence.beans.user.UserContacts</class>
<class>org.openmeetings.app.persistence.beans.user.Userdata</class>
 <class>org.openmeetings.app.persistence.beans.user.Userlevel</class>
<class>org.openmeetings.app.persistence.beans.user.UserSipData</class>
 <class>org.openmeetings.app.persistence.beans.user.Users</class>
<class>org.openmeetings.app.persistence.beans.files.FileExplorerItem</class>

<class>org.openmeetings.app.persistence.beans.sip.asterisk.AsteriskSipUsers</class>

<class>org.openmeetings.app.persistence.beans.sip.asterisk.Extensions</class>

<class>org.openmeetings.app.persistence.beans.sip.asterisk.MeetMe</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
 <properties>
    <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported"/>
            <property name="openjpa.ConnectionDriverName"
value="org.apache.commons.dbcp.BasicDataSource" />
<property name="openjpa.ConnectionProperties"
 value="DriverClassName=com.mysql.jdbc.Driver
,
Url=jdbc:mysql://localhost:3306/openmeetings?autoReconnect=true&amp;useUnicode=true&amp;createDatabaseIfNotExist=true&amp;characterEncoding=utf-8&amp;connectionCollation=utf8_general_ci&amp;cachePrepStmts=true&amp;cacheCallableStatements=true&amp;cacheServerConfiguration=true&amp;useLocalSessionState=true&amp;elideSetAutoCommits=true&amp;alwaysSendSetIsolation=false&amp;enableQueryTimeouts=false&amp;prepStmtCacheSize=3000&amp;prepStmtCacheSqlLimit=1000
 , MaxActive=100
, MaxWait=10000
, TestOnBorrow=true
 , poolPreparedStatements=true
, Username=openmeetings
, Password=XXX"/>
 <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
<property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO" />
 <property name="openjpa.DataCache" value="true"/>
<!-- QueryCache disabled due to changes outside of JPA doesn't take effect
with caching -->
 <property name="openjpa.QueryCache" value="false"/>
<property name="openjpa.jdbc.DBDictionary"
 value="batchLimit=100,tableType=myisam"/>
 <property name="openjpa.jdbc.QuerySQLCache"  value="false"/>
</properties>
 </persistence-unit>
</persistence>

Re: MySQL timeouts?

Posted by Mikael Kurula <al...@gmail.com>.
Hi!

Thanks for the suggestion. I didn't manage to get the time stamps in (I'm a mathematician, not a sysadmin) and I find it unlikely the server has gone down. MySQL is on the same server as OpenMeetings and AFAIK we have nagios watchdogging it, probably also with ping.

Friendly greetings,
Mikael


On 2012.14.12, at 06:45, seba.wagner@gmail.com wrote:

> Yes that is what I meant Mikael.
> 
> In the server on demo.openmeetings.de those config variables are exactly
> the same:
> mysql> SHOW GLOBAL VARIABLES LIKE "wait_timeout";
> +---------------+-------+
> | Variable_name | Value |
> +---------------+-------+
> | wait_timeout  | 28800 |
> +---------------+-------+
> 1 row in set (0.00 sec)
> 
> mysql> SHOW VARIABLES LIKE "wait_timeout";
> +---------------+-------+
> | Variable_name | Value |
> +---------------+-------+
> | wait_timeout  | 28800 |
> +---------------+-------+
> 1 row in set (0.01 sec)
> 
> mysql>
> 
> 
> Another reason might be that the host in general is not available.
> 
> You could for example test this by doing a (nasty) small ping script that
> runs "demon-like".
> 
> For example:
> nohup ping -c 100000000000000 web.de &
> 
> it will write all ping results to a file called nohup.out.
> And you can check the output in real-time using:
> tail -f nohup.out
> 
> with some more "shell kung-fu" I guess you could also add the date part in
> front of every ping result.
> 
> Then you let run the script overnight.
> 
> And tomorrow morning when you see in your openmeetings log file => there
> was a db connection lost, you see in the openmeetings log what time exactly
> the connection lost was
> 
> And then you check the output of your ping protocol in the nohup.out if
> there was any host issue (especially around that date/time of course).
> 
> Sebastian
> 
> 
> 2012/12/13 Mikael Kurula <al...@gmail.com>
> 
>> 2880
> 
> 
> 
> 
> -- 
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com


Re: MySQL timeouts?

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
web.de is of course to be replaced with your database host name ...


2012/12/14 seba.wagner@gmail.com <se...@gmail.com>

> Yes that is what I meant Mikael.
>
> In the server on demo.openmeetings.de those config variables are exactly
> the same:
>
> mysql> SHOW GLOBAL VARIABLES LIKE "wait_timeout";
> +---------------+-------+
> | Variable_name | Value |
> +---------------+-------+
> | wait_timeout  | 28800 |
> +---------------+-------+
> 1 row in set (0.00 sec)
>
> mysql> SHOW VARIABLES LIKE "wait_timeout";
> +---------------+-------+
> | Variable_name | Value |
> +---------------+-------+
> | wait_timeout  | 28800 |
> +---------------+-------+
> 1 row in set (0.01 sec)
>
> mysql>
>
>
> Another reason might be that the host in general is not available.
>
> You could for example test this by doing a (nasty) small ping script that
> runs "demon-like".
>
> For example:
> nohup ping -c 100000000000000 web.de &
>
> it will write all ping results to a file called nohup.out.
> And you can check the output in real-time using:
> tail -f nohup.out
>
> with some more "shell kung-fu" I guess you could also add the date part in
> front of every ping result.
>
> Then you let run the script overnight.
>
> And tomorrow morning when you see in your openmeetings log file => there
> was a db connection lost, you see in the openmeetings log what time exactly
> the connection lost was
>
> And then you check the output of your ping protocol in the nohup.out if
> there was any host issue (especially around that date/time of course).
>
> Sebastian
>
>
> 2012/12/13 Mikael Kurula <al...@gmail.com>
>
>> 2880
>
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: MySQL timeouts?

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Yes that is what I meant Mikael.

In the server on demo.openmeetings.de those config variables are exactly
the same:
mysql> SHOW GLOBAL VARIABLES LIKE "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

mysql> SHOW VARIABLES LIKE "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.01 sec)

mysql>


Another reason might be that the host in general is not available.

You could for example test this by doing a (nasty) small ping script that
runs "demon-like".

For example:
nohup ping -c 100000000000000 web.de &

it will write all ping results to a file called nohup.out.
And you can check the output in real-time using:
tail -f nohup.out

with some more "shell kung-fu" I guess you could also add the date part in
front of every ping result.

Then you let run the script overnight.

And tomorrow morning when you see in your openmeetings log file => there
was a db connection lost, you see in the openmeetings log what time exactly
the connection lost was

And then you check the output of your ping protocol in the nohup.out if
there was any host issue (especially around that date/time of course).

Sebastian


2012/12/13 Mikael Kurula <al...@gmail.com>

> 2880




-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: MySQL timeouts?

Posted by Mikael Kurula <al...@gmail.com>.
Hi!

I'm not quite sure I understood what you want me to check; is this it?

mysql> SHOW GLOBAL VARIABLES LIKE "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

mysql> SHOW VARIABLES LIKE "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

Friendly greetings,
Mikael


On 13 December 2012 10:01, seba.wagner@gmail.com <se...@gmail.com>wrote:

> *is longer than the server configured value of
> 'wait_timeout'. You should consider either expiring and/or testing*
>
> => What is your value of the MySQL configuration wait_timeout ?
>
> See for example also:
> https://www.google.com.au/search?q=MySQL+configure+wait_timeout
>
> If you tell us your config value we can compare it to our running server(s)
> and if there is any discrepancy.
>
> Sebastian
>
>
>
> 2012/12/13 Maxim Solodovnik <so...@gmail.com>
>
> > On Thu, Dec 13, 2012 at 6:35 AM, Mikael Kurula <al...@gmail.com>
> wrote:
> >
> > > I don't know how to check which version of OpenJPA I'm using
> >
> >
> > The version of OpenJPA is: openjpa-bundle-2.2.1.jar
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>

Re: MySQL timeouts?

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
*is longer than the server configured value of
'wait_timeout'. You should consider either expiring and/or testing*

=> What is your value of the MySQL configuration wait_timeout ?

See for example also:
https://www.google.com.au/search?q=MySQL+configure+wait_timeout

If you tell us your config value we can compare it to our running server(s)
and if there is any discrepancy.

Sebastian



2012/12/13 Maxim Solodovnik <so...@gmail.com>

> On Thu, Dec 13, 2012 at 6:35 AM, Mikael Kurula <al...@gmail.com> wrote:
>
> > I don't know how to check which version of OpenJPA I'm using
>
>
> The version of OpenJPA is: openjpa-bundle-2.2.1.jar
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: MySQL timeouts?

Posted by Maxim Solodovnik <so...@gmail.com>.
On Thu, Dec 13, 2012 at 6:35 AM, Mikael Kurula <al...@gmail.com> wrote:

> I don't know how to check which version of OpenJPA I'm using


The version of OpenJPA is: openjpa-bundle-2.2.1.jar


-- 
WBR
Maxim aka solomax