Home » Performance » MySQL » Slow connection to mysql
Slow connection to mysql [message #409] Thu, 23 November 2006 06:38 Go to next message
prdpjohn  is currently offline prdpjohn
Messages: 5
Registered: November 2006
Junior Member
I am configuring a new server - dual processor with 64bit architecture - os : mandriva 2007. i have loaded mysql 4.1.21 and using tomcat 4.1 as my application server. it's observed that the queries takes a long time to excecute. actually i don't know whether it takes time to connect to mysql or taking time to excecute the query - because when actually running programs it takes time to execute the first command. we have the same set up with mysql4.1.12 and it runs smoothly.

can any body help pls?

thanks in advance

pradeep.

Re: Slow connection to mysql [message #410 is a reply to message #409 ] Thu, 23 November 2006 06:46 Go to previous messageGo to next message
Peter  is currently offline Peter
Messages: 405
Registered: August 2006
Senior Member
Super Guru
Why you simply do not try it ?

Connect to MySQL using mysql command line client and see how long connection is taking.

Run a query in question to see how long does it take.


Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.mysqlperformanceblog.com/mysql-consulting/
Re: Slow connection to mysql [message #411 is a reply to message #410 ] Thu, 23 November 2006 07:13 Go to previous messageGo to next message
prdpjohn  is currently offline prdpjohn
Messages: 5
Registered: November 2006
Junior Member
thanks for ur reply peter.

i tried connecting through command and running queries. both are fast and there is absolutely no delay.

this is the connection string i use.

" jdbc:mysql://192.168.0.215/rbcl?user=root&password=***** *****&jdbcCompliantTruncation=false&zeroDateTimeBeha vior=convertToNull&autoRecon
nect=true"; and i am using the following for connection.
mysql-connector-java-3.1.13-bin.jar

thanks
pradeep.



Re: Slow connection to mysql [message #412 is a reply to message #411 ] Thu, 23 November 2006 12:02 Go to previous messageGo to next message
Peter  is currently offline Peter
Messages: 405
Registered: August 2006
Senior Member
Super Guru
Did you try to connect from the same host as your application is running on ?

The host which you connect from matters in connection speed.

Also what does SHOW PROCESSLIST shows when you experience connection delay ?

I expect you have problems with DNS - using --skip-name-resolve MySQL server option may help.


Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.mysqlperformanceblog.com/mysql-consulting/
Re: Slow connection to mysql [message #417 is a reply to message #412 ] Thu, 23 November 2006 23:36 Go to previous messageGo to next message
prdpjohn  is currently offline prdpjohn
Messages: 5
Registered: November 2006
Junior Member
hi peter. thanks for ur reply.

i tried using --skip-name-resolve, but it does n't help.

this is what i get when i try login through i my application

Id User Host db Command Time
State Info

during login

84 unauthenticated user 192.168.0.11:35523 NULL Connect NULL login NULL

after login

87 root 192.168.0.11:59400 rbcl Sleep 14
-- NULL

when i try to connect to mysql through telnet it happens instantly.

thanks
regards
pradeep.

Re: Slow connection to mysql [message #418 is a reply to message #412 ] Fri, 24 November 2006 02:47 Go to previous message
prdpjohn  is currently offline prdpjohn
Messages: 5
Registered: November 2006
Junior Member
hi peter.

thank u so much for ur prompt reply. i tried changing the dns and gateway settings in the os and that solved our problem. now it connects fast and all our applications works smoothly.

once again thanking u for the hint.

regards
pradeep.
Previous Topic:How many times are my indexes used?
Next Topic:Normal for mysql to strip trailing spaces?
Goto Forum:
  



Current Time: Wed Jan 7 12:48:11 EST 2009

Total time taken to generate the page: 0.01479 seconds
.:: Contact :: Home :: MySQL Support by Percona.com ::.

Powered by: FUDforum 2.7.5.
Copyright ©2001-2006 FUD Forum Bulletin Board Software

MySQL Performance | Forum authority Badge