MYSQL sites suddenly very slow to load.

mattc

Verified User
Joined
Mar 25, 2009
Messages
16
compare these 2 links speedwise.
MYSQL Driven - http://www.different-way.com/contact-me/
static page - http://www.different-way.com/readme.html

I know static always loads faster than php with database but the difference suddenly is massive.

System specs

Processor Name Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Vendor ID GenuineIntel
Processor Speed (MHz) 2493.767
Processor Name Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Vendor ID GenuineIntel
Processor Speed (MHz) 2493.767
Processor Name Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Vendor ID GenuineIntel
Processor Speed (MHz) 2493.767
Processor Name Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Vendor ID GenuineIntel
Processor Speed (MHz) 2493.767
Processor Name Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Vendor ID GenuineIntel
Processor Speed (MHz) 2493.767
Processor Name Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Vendor ID GenuineIntel
Processor Speed (MHz) 2493.767
Processor Name Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Vendor ID GenuineIntel
Processor Speed (MHz) 2493.767
Processor Name Intel(R) Xeon(R) CPU E5420 @ 2.50GHz
Vendor ID GenuineIntel
Processor Speed (MHz) 2493.767
Total Memory 4139432 kB
Free Memory 2608884 kB
Total Swap Memory 9863868 kB
Free Swap Memory 9863868 kB
System Uptime 1 Days, 3 Hours and 32 Minutes
Apache 2.2.11 Running
DirectAdmin 1.36.2 Running
Exim 4.67 Running
MySQL 5.0.77 Running
Named 9.5.0 Running
ProFTPd 1.3.2 Running
sshd Running
dovecot 1.1.13 Running
Php 5.2.9 Installed


TOP results

top - 11:32:01 up 1 day, 3:33, 3 users, load average: 0.15, 0.11, 0.03
Tasks: 216 total, 1 running, 215 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3%us, 0.1%sy, 0.0%ni, 99.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 4139432k total, 1543500k used, 2595932k free, 272616k buffers
Swap: 9863868k total, 0k used, 9863868k free, 755300k cached

Usage Stats

Usage Stats for eth0
Received 152.5 MB
Transmitted 1.3 GB
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 907G 148G 714G 18% /
tmpfs 2.0G 0 2.0G 0% /lib/init/rw
tmpfs 2.0G 0 2.0G 0% /dev/shm
udev 2.0G 2.7M 2.0G 1% /dev
varlock 2.0G 0 2.0G 0% /var/lock
varrun 2.0G 92K 2.0G 1% /var/run

Can not find any errors in http logs or syslogs.

Please let me know what more info is needed to assist.

Thanks,

Matt C
 
the load average seems to be ok and no swap used, try optimize mysql databases.

a normal php file without mysql connection load fast?

I also suggest you to make some update.. you got mysql, exim, directadmin, php and other not up2date.

Regards
 
Thanks for the reply. a phpinfo page loads as fast as a static html page.

Auto updates failing. Will try the manual updates.
 
Can not update directadmin as well....

Here is my directadmin directory after the wget of the update...

drwx------ 2 diradmin diradmin 4096 2011-03-21 15:49 conf
-rwx------ 1 diradmin diradmin 881572 2010-09-21 14:01 da-popb4smtp
drwx--x--x 8 diradmin diradmin 4096 2011-04-06 13:27 data
-rwx------ 1 diradmin diradmin 5095336 2010-09-21 14:01 dataskq
-rwx------ 1 diradmin diradmin 5076374 2010-09-21 14:01 directadmin
drwxr-xr-x 2 diradmin diradmin 4096 2009-04-20 10:27 .ncftp
drwxr-xr-x 3 diradmin diradmin 4096 2009-03-27 14:25 plugins
drwx--x--x 4 diradmin diradmin 4096 2010-09-21 14:01 scripts
-rw------- 1 diradmin diradmin 45 2011-04-06 13:36 update.tar.gz

When I run head on the update file I get - * You are not allowed to run this program *

Yes I am using sudo.

Thanks!
 
i should be wrong but i cant see custombuild directory?

For reinstall should be:

Code:
cd /usr/local/directadmin
wget http://files.directadmin.com/services/custombuild/1.2/custombuild.tar.gz
tar zxfv custombuild.tar.gz
cd custombuild
./build update
./build version

At the end you should see all avaible updates.

And doing ./build you will see the list of avaible commands for install/update stuffs.

Regards
 
None that I could possibly imagine. This mysql was installed with the directadmin. My directadmin upgrade fails and an apt-get -u upgrade does not include mysql or exim, or php in the list of packages to be upgraded. I also just copied my-large.cnf to /etc/my.cnf and restarted mysql.... No help.

Any reason why I have mysqld and mysqld_safe running at the same time?

root 3368 0.0 0.0 2620 1164 ? S 13:55 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/host.pid

mysql 3401 0.4 1.1 378416 48112 ? Sl 13:55 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/local/mysql/data/host.pid --skip-external-locking --port=3306 --socket=/tmp/mysql.sock
 
i should be wrong but i cant see custombuild directory?

For reinstall should be:

Code:
cd /usr/local/directadmin
wget http://files.directadmin.com/services/custombuild/1.2/custombuild.tar.gz
tar zxfv custombuild.tar.gz
cd custombuild
./build update
./build version

At the end you should see all avaible updates.

And doing ./build you will see the list of avaible commands for install/update stuffs.

Regards

Custombuild is there I just didnt include in the paste of the directory listing. What are the consequences of doing a reinstall instead of following directadmin directions for a manual upgrade?
 
you cant update exim php apache and directadmin related software via apt-get or yum.

use custombuild for update those, use

Code:
cd /usr/local/directadmin/custombuild
./build update
./build version


so you can check what you can update.

Regards
 
Stupid question deleted

you cant update exim php apache and directadmin related software via apt-get or yum.

use custombuild for update those, use

Code:
cd /usr/local/directadmin/custombuild
./build update
./build version


so you can check what you can update.

Regards
 
Last edited:
Just a quick update.

I have the mysql upgraded and I was able to get it working again. The server is back to the mysql sites being slow which is good. Once the site does come up though it travels through the site pretty well now. Thought this might help.
 
1. Check with the script http://mysqltuner.pl/mysqltuner.pl Probably you need tune MySQL (/etc/my.cnf).

2. Enable mysql slow logs and learn logs. Probably you need to add additional keys in MySQL tables.

3. Your disk partitions are not good to me. I would not recommend to use one partition as you use it for now. I'd suggest you adding a second HDD (temporary or permanently) and make partitions as it's recommended here (see "For a less simple partition structure" section).
 
If the first page of the site takes time to come up but other pages come up quickly, then the problem may very well be in DNS resolution.

Jeff
 
Back
Top