error establishing database connection every day at the same time.

Status
Not open for further replies.
d0xPhHG.png


I'm trying to kill apache + mysql but due to overload i can't.


3z9rGff.png


I/O of server seems unstable and slow...
 
There servers are always slow like that. I never get more than 3-6MB/s . That has always been my biggest complaint with them. But I do not serve a lot of big files and have limited connections to 20 per ip and it runs 3 ipb and 2 custom sites fairly well.


Sort your top by memory instead of cpu so I can see what is eating all the memory..


Mine never exceeds the 1 gig mark.
 
Your host seems overselling as seen on I/O results . Server is unstable due to many httpd requests as well . Try to login into ssh and stop apache and check if load goes down . If it does then switch over to lighttpd from apache or nginx maybe .
 
He is using lighttpd..


And I don't believe it is overselling but the wrong mixture of website types. Plus they are in romania and bucharest and so forth.
 
[root@ ~]# /etc/init.d/mysqld restart
Stopping MySQL: [FAILED]
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
It can't connect to mysql.

I had found the solutions on the web...this can be happen because of so many reasons..you can check out the solutions below...

http://www.webburr.com/wordpress/error-establishing-database-connection-wordpress/748


http://www.wpbeginner.com/wp-tutori...ablishing-a-database-connection-in-wordpress/
 
Last edited:
Well Apache was overloading the server , his wordpress was constantly serving index.php with high load without having any cache enhancer on his site as well as on the server .

What i did :-

1 . Stopped Apache first , then updated his system by :-
PHP:
yum update
2 . Then updated the Kloxo , which was already updated but still :-
PHP:
sh /script/upcp
3 . Then i started the procedure to install nginx over Kloxo , i already having them listed on my ebooks but still :-

PHP:
mkdir /tmp/kloxo-test
cd /tmp/kloxo-test
rm -rf index*
### wget 'http://forum.lxcenter.org/index.php?t=getfile&id=1587'
### wget 'http://forum.lxcenter.org/index.php?t=getfile&id=1588'
### wget 'http://forum.lxcenter.org/index.php?t=getfile&id=1591'
### wget 'http://forum.lxcenter.org/index.php?t=getfile&id=1592'
### wget 'http://forum.lxcenter.org/index.php?t=getfile&id=1593'
wget 'http://forum.lxcenter.org/index.php?t=getfile&id=1596'
mv index* kloxo.zip
unzip kloxo.zip

Backup Original Kloxo
PHP:
yes | cp -rf /usr/local/lxlabs/kloxo /usr/local/lxlabs/kloxo.bck

Over write the code
PHP:
yes | cp -rf ./kloxo /usr/local/lxlabs

Then few more steps :-

PHP:
sh /script/cleanup

PHP:
echo '[centalt]' > /etc/yum.repos.d/kloxo-centalt.repo
echo 'name=centalt - $basearch' >> /etc/yum.repos.d/kloxo-centalt.repo
echo 'baseurl=http://centos.alt*****repository/centos/5/$basearch/' >> /etc/yum.repos.d/kloxo-centalt.repo
echo 'enabled=1' >> /etc/yum.repos.d/kloxo-centalt.repo
echo 'gpgcheck=0' >> /etc/yum.repos.d/kloxo-centalt.repo
echo 'includepkgs=nginx mod_rpaf' >> /etc/yum.repos.d/kloxo-centalt.repo

PHP:
sh /script/fix-chownchmod

Installing nginx makes the server IP as the visitor IP as well , which refers mod_rpaf then i proceeded to install the same :-

Code:
# cd /usr/local/src
# wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz
# tar xzvf mod_rpaf-0.6.tar.gz
# cd mod_rpaf-0.6

httpd-devel is the package required to run apxs , so i installed that first :-

Code:
yum install httpd-devel gcc

PHP:
# apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c

Code:
# vim /etc/httpd/conf/httpd.conf

- Find the “LoadModule” list (near the top)
- Add the following lines at the bottom of the “LoadModule” list:

PHP:
LoadModule rpaf_module modules/mod_rpaf-2.0.so
# mod_rpaf Configuration
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 10.0.0.1
RPAFheader X-Forwarded-For

Restart Apache for the changes to take effect
Code:
/etc/init.d/httpd restart

Now after all , i rebooted the node and then logged in into Kloxo and switched to Nginx with php-fpm .

Once its done , i enabled xcache by the following command :-

PHP:
sh /script/xcache-install

Then restarted httpd , mysql and nginx all together ! Overall worked very well .

If anyone else is facing load issues , feel free to contact me ;) I'll be happy to assist you without any cost .
 
So all thing you need to do is just free your cache memory once a day. I am damn sure your mysql eating a lot a of cache and it doesnt find some free space and gives you error.

So Just free your cache .
 
So all thing you need to do is just free your cache memory once a day. I am damn sure your mysql eating a lot a of cache and it doesnt find some free space and gives you error.

So Just free your cache .

Cache doesn't play a big role but can help anyways . If you need performance then you need to optimize things else regular setup can anytime cause you a problem ;)
 
Status
Not open for further replies.
Back
Top