Forums | Mahara Community
Developers
/
Error "Too many connections in Mysql" if I set up cron.php every minute.
30 January 2012, 2:33
Hello people, It´s great to know about you again.
Would you mind helping me? Whatever stuff is good now.
My matter with mahara is the following:
When I set up the cron.php every minute It is occurred that our Mahara launchs quite fast an Mysql error telling "Too many connections...." even the database become shutted down by itself and then it restart back automatically.
My Mahara site cron script have been for a few months without being activated; I had never set up it before so I supposed that there are too many tasks in the line waiting for being done.
I belong to a several groups in my mahara site and when I just set up then cron.php every minute I begin to receive a lot of email notifications from the forums.
Why could it be ocurring?
How could I delete the list of all tasks untill now? I don't mind if all planificated cron tasks are not done.
My best regards and hugs for everybody. I'll be waiting for your answers.
30 January 2012, 14:56
Hi Raúl,
Your mySQL settings might have the maximum connection limit set quite low. You can change it in the my.cnf file, which if you're using Linux will be either in /etc/ or in the /etc/mysql/ directory. You may need to uncomment it.
http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_max_connections
After you've cleaned out the queue, you should probably revert the max_connections setting back to what it was previously, and then make sure your cron is running successfully with a normal load.
Thanks,
Melissa
31 January 2012, 2:47
Melissa, thanks a lot for your reply, it´s very interseting.
I catched everything you told me but, I don´t know yet how I would have to clean the queue of tasks planificated for being executed by my cron.
I wish my cron began executing tasks like today were the first day on my mahara installation, in this way, there wouldn't have so many tasks waiting and my users don´t get angry recieving so many email in their email accounts when I hit the cron.php .
if i lanuch my cron trough the command line,"Too many connections" error dessapears, therefore I could let it doing all its scheduled jobs but it keeps being a problem for me because It begins to send too many email notifications to my users.
In conclusion, how i could erase all the tasks planificated by my cron.php script?
My best regards and yours faithfully.
31 January 2012, 16:58
Raúl,
Clearing out the cron queue means you either need to let it run its course, or go into the database and for each type of message that gets sent, manually set the sent flag in the table row.
For example, forums mails would be:
UPDATE interaction_forum_post SET sent = 1 WHERE ctime < '2012-02-01 11:41:16';
You will want to change that timestamp to be the cut off time for the mails.
I don't know what other types of mails you're being flooded with. Possibly the forums ones mostly.
Thanks,
Melissa.
01 February 2012, 11:09
Thanks for all Melisa. I hope you were patient with my poor English.
I have browsed among the rows of the table you indicates and as you said there are a field called sent and the ctime. OK I am going to make some tests before change it in my mahara production site and will post again.
Thanks for your support; here i will be if i was helper for you.