• psnation

    (@psnation)


    I am trying to mass message 2500 members and it sends some messages but eventually crashes my server. I am on a dedicated server with plenty of power and using Buddypress 2.7. I’m guessing it is a timeout issue because my other sites on the same server are not affected by the crash

    A few questions…

    1. Is there an option to send messages in batches of 100?
    2. When a message is sent to all users does it trigger an email to be sent to the user as a private message does?
    3. Is there

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author antonioeatgoat

    (@antonioeatgoat)

    Hi psnation,

    The issues make sense, 2500 users are really a lot, we have not tested with a so big database.

    A temporary solution would be open the file alkaweb-mass-messaging-for-buddypress.php, saerch for:

    foreach($receivers as $user) {
    	if($user->ID == get_current_user_id())
    		continue;
    
    	if( messages_new_message( array('sender_id' => get_current_user_id(), 'subject' => $subject, 'content' => $content, 'recipients' => $user->ID) ) )
    		$c++;
    
    }

    and replace with:

    foreach($receivers as $user) {
    	if($user->ID == get_current_user_id())
    		continue;
    
    	if( messages_new_message( array('sender_id' => get_current_user_id(), 'subject' => $subject, 'content' => $content, 'recipients' => $user->ID) ) )
    		$c++;
    
    	if ($c % 30 == 0) {
    		sleep(1);
    	}
    }

    If you try it, please let me know about the results ??

    Thread Starter psnation

    (@psnation)

    I tested it out but after a while my server still timed out. There was another Mass Messaging plug in I found before yours and it worked by sending batches of 100 at a time. 100 of 2500, 200 of 2500, 300 of 2500 etc. Maybe you could implement something like that.

    If it could trigger an auto email to each member alerting them they have received a private message would be great too.

    Plugin Author antonioeatgoat

    (@antonioeatgoat)

    Hi psnation,

    Sorry for big delay, we will improve for sure this in future, I hope we will do as soon as possible ??

    If you PHP is not running in safe mode (very uncommon) and you want try another temporary solution, you can replace sleep(1); with set_time_limit(30);

    Hi, I tried all the solutions, however, the site always returns a “no data was received” error. Some messages are sent, but not all messages.
    Cheers

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Large Database’ is closed to new replies.