Google Answers Logo
View Question
 
Q: Linux Apache / MySQL / PHP server suddenyl running slow, need to find out why ( No Answer,   0 Comments )
Question  
Subject: Linux Apache / MySQL / PHP server suddenyl running slow, need to find out why
Category: Computers > Programming
Asked by: mdmbud-ga
List Price: $50.00
Posted: 05 Jan 2005 18:01 PST
Expires: 06 Jan 2005 07:01 PST
Question ID: 452697
We have a server running Apache 1.3, PHP 4.21 with PHPA, and MySQL 3.23

About a week end we had an incident where some fields in several
hundred MySQL database records zeroed.   I was able to restore the
data from a backup.  I also rebooted at about the same time (prior to
that, the sever had been up for about a month).

Since then the server seems to be running MUCH slower.  I don't know
whether it is due to the DB problem, or something else.  When running
top, it is not unusual to see a load average of 3 or 4 or higher even
though the CPU is 95% idle most of the time.

Here is a typical top display:

  7:40pm  up 3 days,  2:08,  3 users,  load average: 3.90, 3.21, 2.48
122 processes: 119 sleeping, 2 running, 1 zombie, 0 stopped
CPU states:  1.8% user,  2.4% system,  0.0% nice, 95.8% idle
Mem:  512584K av, 507580K used,   5004K free,      0K shrd,   8992K buff
Swap: 1445808K av,  25500K used, 1420308K free                376276K cached

In the past we have sometimes have had this problem when our access or
error logs got real big, so I made sure that was not the case.

I have a gut feeling this is a DB problem, but am not sure how to go
about finding where the slowdown is.  It seems to be across the board,
not any specific pages (we have over 300 PHP pages on the site).  We
are running mytop, but that doesn't seem to show anything unusual.

Typical display:

MySQL on localhost (3.23.54-log)                        up 0+02:29:04 [19:51:20]
 Queries: 178.9k  qps:   20 Slow:    66.0         Se/In/Up/De(%):    85/02/09/00
             qps now:   31 Slow qps: 0.0  Threads:    6 (   3/   4) 86/00/08/00
 Key Efficiency: 99.8%  Bps in/out:  2.1k/64.6k   Now in/out:  2.6k/140.5k

The # of slow queries is (66.0 in the above display) is increasing a
couple of counts per minute.

In the past, I have have added additional indicies to tables which
seemed to help overall, but I haven't changed the DB or added any new
queries lately, so there is no reason why things should have slowed
down.

So, MY QUESTION IS:

How can I determine why my server load is so high all of a sudden?  Is
there a way I can determine if it is an MySQL problem?  Are there ways
of displaying the time it takes for specific queries to execute
(without having to go in and modify dozens of PHP pages), or to
display all queries that take over a certain time to run?

Thx

Request for Question Clarification by webadept-ga on 05 Jan 2005 19:04 PST
Hi, 

Check for a rootkit installation

http://www.chkrootkit.org/

and let us know what you find. 

thanks, 

webdept-ga

Clarification of Question by mdmbud-ga on 06 Jan 2005 05:55 PST
We ran chkrootkit, but didn't find anything -- it displayed one thing
which it called a "possible LKM Trojan" but it turned out to be a
false positive.  I also ran rkhunter just to be sure.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy