Wordpress suddenly very slow - PHP + MySQL problems?

Support/Development for PHP
zooming
Forum User
Forum User
Posts: 27
Joined: Tue Jan 15, 2008 9:01 am

Wordpress suddenly very slow - PHP + MySQL problems?

Unread post by zooming »

Hello,

I have one large site with Wordpress 2.7.1

It suddenly has become very slow. It was working fine, and after last Saturday it has become very slow.

The server load didn't change (1 to 3 in average), neither the memory usage, network usage, disk IO and the number of connections.

I have checked the Wordpress records in the database, everything looks fine (just a few ordinary new posts and comments).

ASL's records didn't show anything unusual.

Using Apache's "server-status" page, I can see several connections to this site with the status "W" - Sending reply. They take a long time to finish, eventually taking all server connections available.

Using MySQL "show processlist" query, I can see several connections for this site's database, almost all with "Sleep" command and Info = NULL.

I have several other sites running in the same server, but this is by far the one that is consuming more resources (it wasn't), so almost all records returned from the "show processlist" query shows connections for this site's database.

I have checked the site's Apache error_log file, and I can see some MySQL errors - MySQL has gone away. It looks like that this error is mostly related to connections closed by the server.

So the connections are taking to long to finish, and some times they are forcebly closed (MySQL has gone away), but most of the time they are "sleeping" in the MySQL server.

I have changed some MySQL's parameters, but without success (set-variable=wait_timeout=100 and other values, set-variable=long_query_time=1, log-slow-queries=/var/log/mysql/log-slow-queries.log). The slow query log does not show the queries for this database, although it shows for others.

I have reinstalled Wordpress, using only a database dump from the old site, and I have disabled all Wordpress plugins, but nothing worked.

Wordpress WP Super Cache is enabled and running (cache files are being generated).

Does anyone have a tip on how should I continue to troubleshoot this problem?

Thank you.

Alexandre

----

Server info:

PHP 5.2.9 (cli) (built: Mar 10 2009 16:42:52)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

Server version: Apache/2.2.3
Server built: Jan 21 2009 22:01:41

mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1

2.6.27.7-9.art.i686.PAE

ASL version 2.0.7
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Re: Wordpress suddenly very slow - PHP + MySQL problems?

Unread post by scott »

Yeah first thing I would do is install mysqltuner (yum install mysqltuner) and see how it looks. Are you using any php acclerators?
zooming
Forum User
Forum User
Posts: 27
Joined: Tue Jan 15, 2008 9:01 am

Re: Wordpress suddenly very slow - PHP + MySQL problems?

Unread post by zooming »

Hello,

I have used the tuning-primer.sh a few months ago, I'll try mysqltuner too.

I'm using only eAccelerator v0.9.5.3, but it was already enabled before the problem has started.

Thank you.
Alexandre
zooming
Forum User
Forum User
Posts: 27
Joined: Tue Jan 15, 2008 9:01 am

Re: Wordpress suddenly very slow - PHP + MySQL problems?

Unread post by zooming »

Hello,

I have made some adjustments in MySQL with values suggested by mysqltuner, but it didn't work too.

An OPTIMIZE TABLE in every table of the site's database didn't help either.

I'm reseting apache every 30 minutes.

Without this, this particular site gets all the available connections.

I have made a test a few hours ago, turning of this apache reset.

It took 2 hours to the site use every connection available (as far as I could see using apache's server-status).

Apache's server-status page shows all pages in the "W" Sending Reply state. It looks like the page never finishes.

I'm trying to set a TimeOut directive in httpd.conf with a value of 30 seconds. Let's see what happens.

Thank you.
Alexandre
Post Reply