LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 02-25-2009, 05:38 AM   #1
ayush1440
Member
 
Registered: Dec 2007
Posts: 75

Rep: Reputation: 15
mysql response slow


Hello friends,

You all helped me lot before, now again i need your help.

I have installed apache web server and mysql on same system. Both server are working very well and response is also good. But since last 3 days, i found mysql response is very slow. Before it response in 2-3 seconds but now it takes more than 1 minute on same query.
And mysql database is not so bigger. It has a only resume database.

can anybody help to to figure it out?

Let me know if additional information is needed?

Thank you in advance.

It would really appreciated.
 
Old 02-25-2009, 05:41 PM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
Well, first thing is to ensure it's not a load issue. Check using top and/or "ps aux | grep mysqld" to see how much load, RAM usage and CPU usage it is using to ensure their is not a resource issue. Also when you say MySQL is slow, is this via a direct login using the mysql client or an alternative mode? Good idea to check it's actually MySQLd being slow and not potentially something else.
 
Old 02-26-2009, 03:59 AM   #3
ayush1440
Member
 
Registered: Dec 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by r3sistance View Post
Well, first thing is to ensure it's not a load issue. Check using top and/or "ps aux | grep mysqld" to see how much load, RAM usage and CPU usage it is using to ensure their is not a resource issue. Also when you say MySQL is slow, is this via a direct login using the mysql client or an alternative mode? Good idea to check it's actually MySQLd being slow and not potentially something else.
Actually i figure it out that mysql response is not slow. Cause i connect from another system, it replies quick but i apache has some problem. Cannot figure it what is problem.

my ps -aux | grep mysqld replies
# ps -aux | grep mysql
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 2167 0.0 0.0 4448 1260 ? S Feb24 0:00 /bin/sh /usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --pid-file=/var/run/mysqld/mysqld.pid --log-error=/var/log/mysqld.log
mysql 2200 0.0 1.3 137664 28716 ? Sl Feb24 0:00 /usr/libexec/mysqld --defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/var/lib/mysql/mysql.sock
root 29437 0.0 0.0 3916 680 pts/1 S+ 04:54 0:00 grep mysql



My apache server is on same system and i connect mysql by localhost. Whenever i request for any query by apache, it response is very slow. On same query from another system to this mysql connection, replies very quick.

Now cannot understand why same system apache cannot query response fast. I suffer this problem since last 3-4 days. Before it was working very well.

Last edited by ayush1440; 02-26-2009 at 04:09 AM. Reason: command reply
 
Old 02-26-2009, 06:23 AM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
Might be worth knowing what are using to connect to MySQL, PHP, Perl, etc... As a question have you tried restarting Apache and MySQL services? I would advise doing it at a time what is least service effecting since I am guessing this is a production server. You should be able to restart the services with "/etc/init.d/httpd restart" for apache and "/etc/init.d/mysqld restart", however service names might be slightly different.

PS. It's ps aux not ps -aux as you might expect, I have made that mistake a few times too.
 
Old 02-26-2009, 07:23 AM   #5
ayush1440
Member
 
Registered: Dec 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by r3sistance View Post
Might be worth knowing what are using to connect to MySQL, PHP, Perl, etc... As a question have you tried restarting Apache and MySQL services? I would advise doing it at a time what is least service effecting since I am guessing this is a production server. You should be able to restart the services with "/etc/init.d/httpd restart" for apache and "/etc/init.d/mysqld restart", however service names might be slightly different.

PS. It's ps aux not ps -aux as you might expect, I have made that mistake a few times too.
I already tried to restart apache and mysqld too. Even more i remove apache and reinstalled with newer version, still problem exists. I found that apache is responding slow. Mysql is works very well. I tasted mysql querying from another system. mysql response is well.

Cant figure it out for apache.
Let me know if you need further information regarding apache.

Thank you for replying.
 
Old 02-26-2009, 08:26 AM   #6
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
Hi, try checking apache with the "top" command and "ps aux | grep httpd". Check it's not over using resources. Is it possibly a configuration problem? Also what Distribution are you using and did you do any updates recently?
 
  


Reply

Tags
mysql, response


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
X server slow response when connected to slow Wifi bluesmanu Linux - Software 0 04-10-2008 03:44 PM
Slow response robeadam Linux - General 6 09-13-2007 09:31 AM
squid slow response ilnli Linux - Software 10 10-16-2006 11:56 PM
Slow response from MySQL on other server sarmadys Linux - Networking 3 11-03-2005 11:12 AM
Slow response as ..... umok Linux - Newbie 4 07-11-2003 12:54 PM


All times are GMT -5. The time now is 01:20 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration