My site is a messaging site ,There users can send messages to individual and group messages,In group there are about large number of people, if users send to message to group, the server time outs and the site got ha开发者_如何学Cng for 2 hrs. Any method to solve these problem.
For maximum execution time try:
set_time_limit(0);
Also try to optimize your query. And use sleep in between each interval of 50 or 100 slots.
I recommend you to use cronjob.
http://en.wikipedia.org/wiki/Cron
also you can change it using
void set_time_limit ( int $seconds )
http://php.net/manual/en/function.set-time-limit.php
or change max_execution_time in ini file
http://www.imagedia.com/2009/09/changing-php-ini-for-longer-execution-time/
I would like to know whether your messaging system that handles group messages inside Your DB(i.e. receivers read messages inside your system as facebook) or sending emails out to a group? If it is emails to a group, we can set a cron job or integrate a third mailing system that could resolve your issue. If the messaging is done internally which is stored in your own DB, there is no reason to hang the system for 2 hours unless you designed your database badly or using a faulty logic. It will be better if you could share me the Table structure for keeping the messages and the current logic you used to share it between the group users.
精彩评论