70 Sites And Mysql connection error sometime

kenhirai
Posts: 330
Joined: Wed Jan 02, 2013 4:25 am

70 Sites And Mysql connection error sometime

Post by kenhirai »

I notice if I add more checks, the scripts will return mysql connection error sometime... any way to fix this?
kenhirai
Posts: 330
Joined: Wed Jan 02, 2013 4:25 am

Re: 70 Sites And Mysql connection error sometime

Post by kenhirai »

The software is saying

Warning: mysql_connect() [function.mysql-connect]: Too many connections in /usr/home/kenhirai/domains/filipinawomenphotos.org/public_html/scj/includes/db_modules/mysql.php on line 11
Can not connect to database server.
kenhirai
Posts: 330
Joined: Wed Jan 02, 2013 4:25 am

Re: 70 Sites And Mysql connection error sometime

Post by kenhirai »

My tech guy says the following.

Reduce or eliminate persistent connections to reduce connection usage
Adjust your join queries to always utilize indexes
Your applications are not closing MySQL connections properly
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: 70 Sites And Mysql connection error sometime

Post by admin »

Did you tune mysql ? do you use innodb ?
Don't forget to run script update
kenhirai
Posts: 330
Joined: Wed Jan 02, 2013 4:25 am

Re: 70 Sites And Mysql connection error sometime

Post by kenhirai »

Yes I tune MYSQL, and use ION but too many copies of SmartCJ running same time. Here is what I am doing.

I turn off Rotation for each copy, then turn off proccess for IP for bookmarks those, everything turn off. Then change cron job to some running every minute, some every 2 min and some 3 mins. Here is the question though.

If I tune cron job the way I mentioned above, will it affect the accuracy of stats? What is the max time I should use not to affect stats?
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: 70 Sites And Mysql connection error sometime

Post by admin »

Yes, it will affect stats.
What part of server is overloaded ?
Don't forget to run script update
kenhirai
Posts: 330
Joined: Wed Jan 02, 2013 4:25 am

Re: 70 Sites And Mysql connection error sometime

Post by kenhirai »

MYSQL seriously overloaded. I set max connection to 500 already. Traffic is around 15000 a day. 70 copies of Smart CJ all connect with each other. It crashes the server quite often. Any suggestions?
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: 70 Sites And Mysql connection error sometime

Post by admin »

ok
What hardware part of the server is overloaded ?
Don't forget to run script update
kenhirai
Posts: 330
Joined: Wed Jan 02, 2013 4:25 am

Re: 70 Sites And Mysql connection error sometime

Post by kenhirai »

Ram and IOS harddisk load. Cron Job is overloading and on top of that the mysql has maxed out connection. My conclusion is you can't use more than 20 copies of SMART CJ on same server, connect to each other, and build a traffic network like that.

What I am doing now is to split my sites to alot of VPS hosting servers. But i have encountered problem, how do I setup the slave database base since they are not localhost. What should I use? I see Smartcj Wiki says I can do it on different servers right? how to do?
admin
Site Admin
Posts: 38004
Joined: Wed Sep 10, 2008 11:43 am

Re: 70 Sites And Mysql connection error sometime

Post by admin »

I have clients with 160 sites at one server.
RAM loads sounds ..hm.. strange
Why don't you add some more RAM ?
Don't forget to run script update
Post Reply