I’m just wondering how long it would take a server to integrate 50,000 blogs with BuddyPress… sometime I would imagine… It will be interesting to find out what your problem is as more people reply to your thread.
50,000 users and blogs, really!? that’s certainly going to put BP through it’s paces. What’s your PHP script memory limit set to out of interest.
BP registers all existing blogs on a multisite install when the plugin’s activated — it’s probably using all the memory.
These are my resource limits in php.ini:
max_execution_time = 30
max_input_time = 120
memory_limit = 256M
Any idea what I should set the memory_limit to?
256 is pretty big, what you set it to depends on what is available, and also bear in mind what the limit is actually put in place for which is to prevent a script crashing your server, if you set the limit to all available memory you would be in trouble if a badly written script looped and started to use up all your system memory. If you can try increasing the memory allocation in chunks testing each time to see if that is the problem and at what point or extra amount everything settles down and works, then add a bit of headroom.
Thinking about it you may want to increase the max_execution_time to perhaps double? never needed to adjust this figure myself but with 50,000 blogs to cycle through that execution time might be too short? In fact I would try adjusting that before the mem limit to see if it helps.
Thanks for your suggestions hnla, I’ll try them.
I disabled the default BP function to add all blogs to BP DB table with `add_site_option(‘bp-blogs-first-install’, 1);`
Instead I do my own BP blogs installation for each blog during upgrade:
`function bp_blogs_install_after_multisite_upgrade($blog_id) {
echo(‘Blog ID ‘ . $blog_id . ‘:
‘);
if(!get_blog_option($blog_id, ‘bp-blog-recorded’)) {
$users = get_users_of_blog( $blog_id );
if ( $users ) {
foreach ( (array)$users as $user ) {
$role = unserialize( $user->meta_value );
if ( !isset( $role ) )
bp_blogs_record_blog( $blog_id, $user->user_id, true );
}
add_blog_option($blog_id, ‘bp-blog-recorded’, ‘true’);
echo(‘Blog ID ‘ . $blog_id . ‘ added to BuddyPress database.
‘);
}
} else {
echo(‘Blog ID ‘ . $blog_id . ‘ already in BuddyPress.
‘);
}
}
add_site_option(‘bp-blogs-first-install’, 1);
add_action(‘wpmu_upgrade_site’, ‘bp_blogs_install_after_multisite_upgrade’);
`