Skip to:
Content
Pages
Categories
Search
Top
Bottom

'Recently Active' widget is important but slow – how can I be a solution?

  • Avatar of joesell89
    joesell89
    Participant

    @joesell89

    I use Buddypress and Bbpress on a website that I run. I love WordPress and I really like how these plugins allow me to run a community site within a framework I am used to. Thanks guys!

    I do have a problem though. I have really struggled to find a suitable host for the site as it uses a huge amount of resources compared to a simpler WordPress site. I have found that WP Engine works really well but even there the site does sometimes run out of memory and timeout. They have great support staff who have helped me to work out most of the problems. When I asked them what my single biggest problem was they replied that it was this query:

    SELECT DISTINCT u.user_id as id
    FROM wp_usermeta u
    WHERE u.meta_key = 'last_activity'
    ORDER BY u.meta_value DESC
    LIMIT 0, 5 /* From [example.com/activity/] in [~/wp-content/plugins/buddypress/bp-core/bp-core-classes.php:434] */

    They have suggested that I either remove that functionality, fix the slow query or move to their dedicated service which has more resources to cope.

    Why do I really need this widget?
    My site gets an update every 5-10 minutes but I believe that it still makes the site feel more active if there are the names and avatars of active users in the sidebar. When I disable it my site gets less posts.

    How big is my site?
    I don’t think it is that big, it has 3,700 registered users and 150,000 pageviews per month (according to Google Analytics).

    What am I asking for?
    This issue has been raised in the past but didn’t get any traction. It is really important to me that this widget become more efficient but I don’t feel I want to just have this as a feature request for two reasons.

    1, BuddyPress is free, I can’t expect the developers to work on the whim of a single user (am I the only one?)

    2, If I am forced to upgrade my hosting it will cost me hundreds of dollars a month. In other words I would be happy to sponsor this feature for a modest amount (maybe others can help)

    Can anyone suggest how I move this forward? I have posted things like this before on jobs.wordpress.net but I am not sure if there are any BuddyPress skilled developers on there. How do I know who to pick? How will I know if they have done a good job until I have implemented the fix?

    Can anyone help me to work out exactly what I need here and how to get it started?

    Is there anyone else who needs this fix and wants to help me sponsor it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of pro120
    pro120
    Participant

    @pro120

    You are not alone on this issue. We are seeing very long query responses especially considering how large our users table is now.

    In general queries do no seem very efficient even with a very powerful server we are still getting upwards of 8 to 9 second query load times. Will be trying some additional indexing and possible partitioning of bp_activity and wp_users and wp_usermeta to see if that helps.

    @joesell89 – Did you ever come up with a solution for this? We are considering writing re-writing the Widget to use a transient object or something.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    @pro120 – This should be partially addressed in BuddyPress 2.0 as we’ve moved the last activity entries directly into the activity component to speed up queries.

    If you haven’t upgraded yet, please backup your database before upgrading then give it a shot.

    Avatar of joesell89
    joesell89
    Participant

    @joesell89

    @pro120 as @r-a-y says this has been partially resolved in BuddyPress 2.0 which was a performance focused upgrade.

    I ended up working on a few other things to make the site a little faster but BuddyPress still represents a significant part of the load time on my site. However, it is nothing like as much as it was in 1.9.x.

    The best, quickest and cheapest overhaul of your BuddyPress site that I know of is to upgrade to 2.0 as @r-a-y says.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.