User Tools

Site Tools


mysql:problemresolution

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mysql:problemresolution [2013/07/23 15:50] rlunaromysql:problemresolution [2013/10/04 10:10] (current) – removed rlunaro
Line 1: Line 1:
-====== Problem Resolution ====== 
- 
-===== Problem ===== 
- 
-<code> 
-07/20 01:38:26 hibernate.util.JDBCExceptionReporter     - Communications link failure 
- 
-The last packet successfully received from the server was 7.202.618 milliseconds ago.  The last packet sent successfully to the server was 7.202.618 milliseconds ago. 
- 
- 
-</code> 
- 
-===== Some tools ===== 
- 
- 
-This will show you the current connections: 
- 
-<code> 
-show status like '%onn%'; 
-</code> 
- 
-Example of output: 
- 
-<code> 
-mysql> show status like '%onn%'; 
-+--------------------------+-------+ 
-| Variable_name            | Value | 
-+--------------------------+-------+ 
-| Aborted_connects         | 0     | 
-| Connections              | 50    | 
-| Max_used_connections     | 9     | 
-| Ssl_client_connects      | 0     | 
-| Ssl_connect_renegotiates | 0     | 
-| Ssl_finished_connects    | 0     | 
-| Threads_connected        | 8     | 
-+--------------------------+-------+ 
-7 rows in set (0.00 sec) 
-</code> 
- 
-Pay attention to the data "Threads_connected", which is similar to the result of the ''show processlist''. 
- 
-===== What are the maximum connections that mysql can have ===== 
- 
-<code> 
-show variables like "max_connections"; 
-</code> 
- 
-===== What are the maximum timeout that a connection will be kept open ===== 
- 
-<code> 
-mysql> show variables like '%imeout%'; 
-+----------------------------+----------+ 
-| Variable_name              | Value    | 
-+----------------------------+----------+ 
-| connect_timeout            | 10       | 
-| delayed_insert_timeout     | 300      | 
-| innodb_lock_wait_timeout   | 50       | 
-| innodb_rollback_on_timeout | OFF      | 
-| interactive_timeout        | 28800    | 
-| lock_wait_timeout          | 31536000 | 
-| net_read_timeout           | 30       | 
-| net_write_timeout          | 60       | 
-| slave_net_timeout          | 3600     | 
-| wait_timeout               | 28800    | 
-+----------------------------+----------+ 
-10 rows in set (0.00 sec) 
-</code> 
- 
-===== Maybe c3p0 has the solution ===== 
- 
-Eventually I've implemented a configuration in the connection pooling mechanism to: 
- 
-  * verify the connection when it enters into the pool 
-  * put a timeout to this connection, releasing it after this period 
- 
-This will prevent the case when a connection is held but the JDBC driver drops out.  
- 
-My config parameters: 
- 
-<code xml> 
-    <property name="minPoolSize" value="2"/> 
-    <property name="maxPoolSize" value="4"/> 
-    <property name="initialPoolSize" value="1"/> 
-    <!-- good for mysql. For oracle, select * from dual could be good enough --> 
-    <property name="preferredTestQuery" value="select 1"/> 
-    <property name="testConnectionOnCheckin" value="true"/> 
-    <property name="idleConnectionTestPeriod" value="60"/> 
-</code> 
- 
-And where I've taken them: 
- 
-http://www.mchange.com/projects/c3p0/ 
- 
- 
- 
  
mysql/problemresolution.1374594645.txt.gz · Last modified: 2022/12/02 21:02 (external edit)