Skip navigation links

MySQL Forums :: Connector/JDBC and Java :: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure


Advanced Search

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Posted by: ma haibo ()
Date: March 03, 2008 09:08PM

help!
most of the time connection works ok.
somtime we are getting

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 119977 ms ago.

I use mysql 5.0.27.
The server have 4G memory.
in my.cnf:
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 10M
max_connections=1000
table_cache = 512
sort_buffer_size = 1024M
read_buffer_size = 1024M
join_buffer_size = 2000M
key_buffer_size = 1024M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 1024M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

innodb_additional_mem_pool_size = 64M
innodb_autoextend_increment = 256M

innodb_buffer_pool_size = 2096M # 50% ~ 80% of system memory
innodb_additional_mem_pool_size = 64M


java code :
public synchronized static DataSource createDataSource(String driver,String url,String username,String password) throws SQLException, ClassNotFoundException {

Class.forName(driver);

DataSource ds_unpooled = DataSources.unpooledDataSource(url,username,password);

Map overrides = new HashMap();

overrides.put("acquireIncrement", 2);
overrides.put("minPoolSize", 15);
overrides.put("maxPoolSize", 30);

overrides.put("maxStatements", 10000);

overrides.put("maxIdleTime", 3600 );

overrides.put("automaticTestTable", "C3P0TestTable");
overrides.put("testConnectionOnCheckin", true);

overrides.put("idleConnectionTestPeriod",180);
overrides.put("testConnectionOnCheckout", true);

// create the PooledDataSource using the default configuration and our overrides
DataSource ds_pooled = DataSources.pooledDataSource( ds_unpooled, overrides );
return ds_pooled;
}

Any help will be greatly appreciated!thank you!

Options: ReplyQuote


Subject Written By Posted
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure ma haibo 03/03/2008 09:08PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure ma haibo 03/04/2008 03:55AM
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure adul adul 02/25/2009 07:17AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Gordon Haywood 03/04/2008 05:54PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure ma haibo 03/04/2008 07:47PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure aaaa bbb 07/07/2010 08:33AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Gordon Haywood 03/05/2008 01:56AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure paul d 03/05/2008 08:32AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Peter Wolf 03/20/2008 09:04AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Penny Koroptvatch 03/30/2008 04:29PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Sultan Tezadov 04/06/2008 12:09AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Bubba Gump 04/07/2008 09:38PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure aaaa bbb 07/07/2010 08:33AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Lukasz Kwiatkowski 04/11/2008 01:54AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Lin klinmy 07/19/2008 01:29AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Anurag Patil 08/03/2009 07:11AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure venkataramana challa 03/04/2009 12:40AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Andrew Sargison 03/10/2009 04:09PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Andrew Sargison 03/12/2009 05:11AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure S KR 05/06/2009 12:30AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Anurag Patil 08/03/2009 07:09AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Ar 3,14 09/18/2009 10:48AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Prasanna Pilla 11/14/2009 12:07PM
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException Abu Jafar 11/17/2009 11:09PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure aaaa bbb 07/07/2010 08:43AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Uros Djokic 12/03/2009 09:16AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Peter Sun 01/15/2010 08:17PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Felix Glez 02/09/2010 03:16AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure Joan Manuel 08/23/2010 11:58AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Jonathan Stuart 03/16/2010 05:13AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Andreas T. 04/26/2010 07:39AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExceptio n: Communications link failure James Peters 05/22/2010 09:12PM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExcept ion: Communications link failure myriam leggieri 06/16/2010 03:43AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsExce ption: Communications link failure myriam leggieri 06/16/2010 08:24AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure aaaa bbb 07/07/2010 08:32AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Double Dragon 06/02/2010 06:01AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure jack fergussen 07/08/2010 08:14AM
Re: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure V C 10/06/2010 08:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.