Post Reply  Post Thread 
Pages (3): « First [1] 2 3 Next > Last »
IO WAIT is High
ratheesh
Junior Member
**

Posts: 13
Group: Registered
Joined: Sep 2006
Status: Offline
Reputation: 0
Post: #1
IO WAIT is High

Hello,

Could you pls help me with the following prob that we have been facing since long...

We work on a LAMP architecture. Our server is quite powerful with two processors and 4GB RAM. we have 80 GB of our Hard disk dedicated to Mysql. Still during peak hours we face a server choke. running mytop shows nearly 60 - 70 mysql threads running. queries which normally take around 5 secs takes around 100 secs to complete. When we see the apache server-status, there are many httpd requests in W state.

Running top shows that there is much IO WAIT (around 60%) and CPU idle is almost 0%. We really dont know what is initiating the problem. Is it apache or is it mysql.

I can post the conf details of mysql and httpd if required..
Kindly chk for a mytop attchmnt.

Thanks

Ratheesh



Attached File(s)
.doc File  Doc1.doc (Size: 63.5 KB / Downloads: 7)
09-06-2006 08:10 AM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #2
RE: IO WAIT is High

Please login to ssh and provide the output of following command:

Code:
uname -a

09-06-2006 11:40 AM
Find all posts by this user Quote this message in a reply
ratheesh
Junior Member
**

Posts: 13
Group: Registered
Joined: Sep 2006
Status: Offline
Reputation: 0
Post: #3
RE: IO WAIT is High

Hello,
I m not permitted to give the Host name here. So it is modified. The rest of info is correct

#uname -a
Linux xxx.yyysolutions.com 2.4.21-4.ELsmp #1 SMP Fri Oct 3 17:52:56 EDT 2003 i686 i686 i386 GNU/Linux

09-06-2006 11:49 AM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #4
RE: IO WAIT is High

I suspected it could be due the kernel version but that's alright. Please post output of:

Code:
ps -wauxf


and output of

Code:
top


Also, please let me know the number and kind of disks you're using. With that powerful server, I think the resource bottleneck is the hard drive. You may need to upgrade to SCSI but let's see the output of those commands first.

09-06-2006 11:59 AM
Find all posts by this user Quote this message in a reply
ratheesh
Junior Member
**

Posts: 13
Group: Registered
Joined: Sep 2006
Status: Offline
Reputation: 0
Post: #5
RE: IO WAIT is High

Hlo,

Pls find attached the result of top and ps.



Attached File(s)
.txt File  top.txt (Size: 3.4 KB / Downloads: 6)
.txt File  ps.txt (Size: 9.35 KB / Downloads: 2)
09-06-2006 12:39 PM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #6
RE: IO WAIT is High

Yes, it's MySQL overloading the server. Please post your my.cnf data so that I can help your tweak few mysql variables. Also let me know your PHP and MySQL version. It won't help you a lot, but it should help you a bit.

Do you already have MySQL on a separate disk?

09-06-2006 12:51 PM
Find all posts by this user Quote this message in a reply
ratheesh
Junior Member
**

Posts: 13
Group: Registered
Joined: Sep 2006
Status: Offline
Reputation: 0
Post: #7
RE: IO WAIT is High

Helo,

I forgot to mention u that the result of top and ps
was taken at a period when there was no load on the server yesterday. When the scenario repeats I will provide the same again for better analysis.

For the time being i am attaching the ps, apache server status, and  mysql processlist results that were taken when the prob occured on 23 June 2006

The my.cnf that you asked has also been attached.

we are running MySQL 4.1.11, PHP 5.0.2.

What problem is MySQL causing? what is initiating the prob?

PS : note the 150 apache requests in W state in the Apache server status. What are ur comments on this?



Attached File(s)
.txt File  ps -aux.txt (Size: 20.73 KB / Downloads: 2)
.txt File  process list .txt (Size: 7.36 KB / Downloads: 1)
.txt File  Apache server status.txt (Size: 20.56 KB / Downloads: 1)
.txt File  my.cnf.txt (Size: 20.67 KB / Downloads: 5)
09-07-2006 04:42 AM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #8
RE: IO WAIT is High

Do you do hosting on this server? Or is that your site? I can see a number of instances of 'yyyLicense.php' in apache. What the php files does? If that's your website, and you got those files custom programmed, you might want to ask the programmer to optimize the scripts for heavy access.

I forgot to ask, are there MySQL databases on the server using InnoDB engine or all/most are using MyISAM?

Quote:
What problem is MySQL causing? what is initiating the prob?

It's tough to say anything at the moment. But it could be because of bad queries, too many queries or something similar. If it's because of too many queries / second, it's quite possible that you're hard drive isn't able to handle that many accesses. Did you read my article on server overloading explained ? It might help you understand your loads and find the resource bottleneck.

Please use the attached stat.php file (modify the USERNAME and PASSWORD string in the file before uploading) to get few MySQL stats and data like queries / second etc. If possible, give me a link to the stats file after you're done. Also this output should be helpful:

Code:
free -m



Attached File(s)
.php File  stat.php (Size: 8.56 KB / Downloads: 5)
09-07-2006 06:34 AM

This post was last modified: 09-07-2006 10:24 AM by Pacifier.

Find all posts by this user Quote this message in a reply
ratheesh
Junior Member
**

Posts: 13
Group: Registered
Joined: Sep 2006
Status: Offline
Reputation: 0
Post: #9
RE: IO WAIT is High

yeah we too were worried about the yyyLicense.php scripts. Its like whenever we encountered there were around 50 - 60 of License requests hanging around in W state until they were timed out.

We checked the script and found nothing fishy. The only thing that we found was that there was a functional semaphore being used in the script. We thought that most probably this might be causing the prob and we wrote a new nonblocking semaphore acquire func in php as an ext ( as sem acquire is always blocking in php ). So now in the nonblocking implementation a request for License will wait only till 12 secs. If it cannot acquire the sem within 12 secs then it exits.

Is the my.cnf ok??

ALL our tables are INNODB type. There are no MyISAM tables at all.

09-07-2006 07:55 AM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #10
RE: IO WAIT is High

I have updated my previous post to include stat.php. Sorry forgot to include ago. The my.cnf looks okay otherwise. It's probably because of number of requests / queries.

Which version of apache you're running? Can you post your key variables such as MaxClients, TimeOut, MaxSpareServers, MinSpareServers, KeepAlive, KeepAliveTimeout etc..

You may need to disable your Apache logs to decrease some I/O usage or upgrading to SCSI drives (or SATA II at least) is another option. Ohh, and before i justify my opinion, please post the output of "free -m" ..

09-07-2006 10:35 AM
Find all posts by this user Quote this message in a reply
Pages (3): « First [1] 2 3 Next > Last »
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: