Bizzare/frustrating Wordpress/Apache/MySQL issue

I have been running a Wordpress blog for more than a year and a half now with no issues. Today I tried to install a second Wordpress blog, but ran into a number of issues.

The second blog installs okay and seems to be running, but as soon as I start loading plugins and themes, my entire linode 512 starts lagging. I eventually get to a point where the first blog is running fine, but as soon as I make a request for the second blog, MySQL crashes. Like literally typing in the URL to the second blog will cause MySQL to lock up to point where both blogs get the "database connection error".

I restart Apache and MySQL and the first blog is accessible again, but anytime I try to request/load the second site everything goes to crap.

I am pretty new to this, but I am stumped. Any help would be much appreciated.

7 Replies

I assume its MySQL because I get the "database connection error" from WP. I am not sure if an Apache issue would cause that.

Also these are my processes listed by memory usage. Should I have this many Apache2 processes?

%MEM %CPU RSS VSZ COMMAND

8.6 3.1 43824 319492 /usr/sbin/mysqld

4.3 0.1 22188 57916 /usr/sbin/apache2 -k start

3.1 0.0 15880 51592 /usr/sbin/apache2 -k start

3.0 0.0 15724 51592 /usr/sbin/apache2 -k start

3.0 0.0 15524 51588 /usr/sbin/apache2 -k start

2.9 0.0 15180 51592 /usr/sbin/apache2 -k start

2.6 0.1 13496 49452 /usr/sbin/apache2 -k start

2.6 0.1 13360 49444 /usr/sbin/apache2 -k start

2.6 0.1 13240 49444 /usr/sbin/apache2 -k start

2.6 0.0 13412 49444 /usr/sbin/apache2 -k start

1.3 0.0 6884 43760 /usr/sbin/apache2 -k start

0.2 0.0 1300 41256 /usr/sbin/apache2 -k start

0.2 0.0 1300 41256 /usr/sbin/apache2 -k start

0.2 0.0 1300 41256 /usr/sbin/apache2 -k start

0.2 0.0 1216 3492 /sbin/init

0.2 0.0 1184 6864 -bash

Apache is a process based web server, so yes seeing quite a bit might be common.

Digging into it a bit more(post crash) I found that the number of apache2 processes more than doubles, and sqld drops down to .8% usage. This is after requesting the second site.

%MEM %CPU RSS VSZ COMMAND

4.0 3.2 20848 56360 /usr/sbin/apache2 -k start

4.0 3.2 20848 56360 /usr/sbin/apache2 -k start

4.0 3.2 20848 56360 /usr/sbin/apache2 -k start

4.0 3.2 20848 56360 /usr/sbin/apache2 -k start

4.0 3.1 20848 56360 /usr/sbin/apache2 -k start

4.0 3.0 20848 56360 /usr/sbin/apache2 -k start

4.0 3.0 20820 56360 /usr/sbin/apache2 -k start

4.0 2.8 20796 56360 /usr/sbin/apache2 -k start

4.0 2.7 20848 56360 /usr/sbin/apache2 -k start

4.0 2.7 20844 56360 /usr/sbin/apache2 -k start

4.0 2.6 20836 56360 /usr/sbin/apache2 -k start

4.0 2.6 20716 56360 /usr/sbin/apache2 -k start

4.0 2.5 20840 56360 /usr/sbin/apache2 -k start

4.0 2.5 20836 56360 /usr/sbin/apache2 -k start

4.0 2.4 20836 56360 /usr/sbin/apache2 -k start

4.0 2.4 20836 56360 /usr/sbin/apache2 -k start

4.0 2.4 20836 56360 /usr/sbin/apache2 -k start

4.0 2.3 20836 56360 /usr/sbin/apache2 -k start

4.0 2.3 20832 56360 /usr/sbin/apache2 -k start

4.0 2.2 20836 56360 /usr/sbin/apache2 -k start

4.0 2.2 20832 56360 /usr/sbin/apache2 -k start

4.0 2.1 20836 56360 /usr/sbin/apache2 -k start

4.0 2.1 20836 56360 /usr/sbin/apache2 -k start

4.0 1.9 20836 56360 /usr/sbin/apache2 -k start

4.0 1.8 20808 56360 /usr/sbin/apache2 -k start

4.0 1.8 20732 56360 /usr/sbin/apache2 -k start

3.5 1.9 18252 56360 /usr/sbin/apache2 -k start

3.1 2.0 16188 53288 /usr/sbin/apache2 -k start

1.8 4.0 9584 56460 /usr/sbin/apache2 -k start

0.9 1.5 4924 56360 /usr/sbin/apache2 -k start

0.9 1.1 4916 56360 /usr/sbin/apache2 -k start

0.9 1.0 4916 56264 /usr/sbin/apache2 -k start

0.9 0.8 4916 56360 /usr/sbin/apache2 -k start

0.9 0.8 4916 56360 /usr/sbin/apache2 -k start

0.9 0.8 4916 56360 /usr/sbin/apache2 -k start

0.8 2.1 4508 331296 /usr/sbin/mysqld

0.7 0.3 3736 41232 /usr/sbin/apache2 -k start

0.3 0.0 1700 41256 /usr/sbin/apache2 -k start

0.3 0.0 1700 41256 /usr/sbin/apache2 -k start

0.3 0.0 1700 41256 /usr/sbin/apache2 -k start

0.3 0.0 1700 41256 /usr/sbin/apache2 -k start

0.3 0.0 1700 41256 /usr/sbin/apache2 -k start

0.3 0.0 1700 41256 /usr/sbin/apache2 -k start

0.3 0.0 1700 41256 /usr/sbin/apache2 -k start

Couple seconds later I get "Error establishing a database connection" on both sites.

What could I have done to make everything crash after loading that one site? I've done this twice now, and I get the same result both times.

Have you checked your Lish console to see if you are exhausting all free RAM (thus killing off MySQL?):

  • ~~[http://library.linode.com/linode-manager/using-lish-the-linode-shell" target="_blank">](http://library.linode.com/linode-manage … node-shell">http://library.linode.com/linode-manager/using-lish-the-linode-shell](

You'll need to keep an eye on the Lish console when experiencing issues.

-Tim

Search for MaxClients in the forum; most likely, your Linode is running out of memory and the Apache configuration needs to be modified.

Lish and MaxClients turned up useful information, thank you!

Currently working on optimizing both MySQL and Apche2.

Quick question, in the apache2.conf do I edit the parameters in all three modules(prefork, worker and event)?

Just prefork the others only apply if you use a different MPM.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct