Title: Large Database
Last modified: October 31, 2016

---

# Large Database

 *  [psnation](https://wordpress.org/support/users/psnation/)
 * (@psnation)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/large-database/)
 * 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](https://wordpress.org/support/users/antonioeatgoat/)
 * (@antonioeatgoat)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/large-database/#post-8390772)
 * 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](https://wordpress.org/support/users/psnation/)
 * (@psnation)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/large-database/#post-8394689)
 * 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](https://wordpress.org/support/users/antonioeatgoat/)
 * (@antonioeatgoat)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/large-database/#post-8414213)
 * 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);`
 *  [liutecristian](https://wordpress.org/support/users/liutecristian/)
 * (@liutecristian)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/large-database/#post-8644770)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/mass-messaging-for-buddypress-by-
   alkaweb_84b442.svg)
 * [Mass Messaging for BuddyPress - by Alkaweb](https://wordpress.org/plugins/mass-messaging-for-buddypress-by-alkaweb/)
 * [Support Threads](https://wordpress.org/support/plugin/mass-messaging-for-buddypress-by-alkaweb/)
 * [Active Topics](https://wordpress.org/support/plugin/mass-messaging-for-buddypress-by-alkaweb/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mass-messaging-for-buddypress-by-alkaweb/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mass-messaging-for-buddypress-by-alkaweb/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [antonioeatgoat](https://wordpress.org/support/users/antonioeatgoat/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/large-database/#post-8414213)
 * Status: not resolved