Page 1 of 4
70 Sites And Mysql connection error sometime
Posted: Sat Mar 30, 2013 6:26 am
by kenhirai
I notice if I add more checks, the scripts will return mysql connection error sometime... any way to fix this?
Re: 70 Sites And Mysql connection error sometime
Posted: Sun Mar 31, 2013 3:01 am
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.
Re: 70 Sites And Mysql connection error sometime
Posted: Mon Apr 01, 2013 5:17 pm
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
Re: 70 Sites And Mysql connection error sometime
Posted: Tue Apr 02, 2013 12:22 am
by admin
Did you tune mysql ? do you use innodb ?
Re: 70 Sites And Mysql connection error sometime
Posted: Tue Apr 02, 2013 2:40 am
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?
Re: 70 Sites And Mysql connection error sometime
Posted: Tue Apr 02, 2013 11:04 am
by admin
Yes, it will affect stats.
What part of server is overloaded ?
Re: 70 Sites And Mysql connection error sometime
Posted: Tue Apr 02, 2013 2:16 pm
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?
Re: 70 Sites And Mysql connection error sometime
Posted: Tue Apr 02, 2013 2:19 pm
by admin
ok
What hardware part of the server is overloaded ?
Re: 70 Sites And Mysql connection error sometime
Posted: Tue Apr 02, 2013 4:54 pm
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?
Re: 70 Sites And Mysql connection error sometime
Posted: Tue Apr 02, 2013 5:44 pm
by admin
I have clients with 160 sites at one server.
RAM loads sounds ..hm.. strange
Why don't you add some more RAM ?