# Mysql database on FreeBSD 7 stuck in sbwait



## nfm (Jan 30, 2009)

Hi,

I'm running a mysql 5.1 server on FreeBSD 7.0 for drupal site with a fairly amount of traffic.

The database server runs fine until the webserver have about 14 page requests per second. Then the load goes down on the database server and it the process became stuck in the "sbwait" mode. Of course when this happens the responstime on the webpage are ridiculously high, sometimes more then 30 seconds.

Does anyone have a clue how to optimize this?

The hardware are not the bottleneck, the server have more than 2/3 of it's resources left when this happens.


----------



## SirDice (Jan 30, 2009)

Look at table locks, some tables benefit from running on InnoDB instead of MyISAM. Turn off the filesystem cache for the InnoDB tables. Also have a look at your slow_query log.


----------



## r-c-e (Jan 30, 2009)

What does SHOW PROCESSLIST show you when this is happening?


----------



## rghq (Jan 30, 2009)

Did you gave mysqltuner / tuning-primer already a try to see if your MySQL configuration is ok ?

Additionally to the things said already


----------



## nfm (Feb 2, 2009)

The strange thing are that mysql are really don't doing much.

If i constantly run "SHOW PROCESSLIST" I rarly hit more then two or three queries.

When i read about the "sbwait" state the information i found said that this state accur when i/o or network performance are lacking.

After running iostat my results indicate that the harddrive are not the problem.

I wonder if the tcp send/recvice buffer could be the problem?


----------



## dfso (Sep 23, 2011)

SirDice said:
			
		

> Look at table locks, some tables benefit from running on InnoDB instead of MyISAM. Turn off the filesystem cache for the InnoDB tables.



How does one "off the filesystem cache for the InnoDB tables" ?


----------

