Skip to:

Buddypress with large scale users

  • Fazlur Khan


    I am trying to optimise a wordpress (4.8.3)/ BuddyPress (2.8.2) site with 5000+ users hosted in WPEngine. Getting error in WPEngine error log.

    The WPEngine error log shows following error:
    [Wed Nov 15 23:50:15.430014 2017] [:error] [pid 21215] [client]
    KILLED QUERY (35690 characters long generated in
    SELECT COUNT(u.user_id) FROM wp_bp_activity u WHERE 1=1 AND u.component = ‘members’ AND u.type = ‘last_activity’
    AND u.user_id IN (72,790,8 …..

Viewing 1 replies (of 1 total)

  • Boone Gorges


    There are a couple places where BuddyPress itself adds an IN clause like this to the user query.

    1. When showing a list of a user’s friends:

    2. When joining against the user meta table because of some sort of meta_query:

    3. When parsing the include parameter, which can be populated by a plugin or by a group member query:

    It’s hard to give exact advice without knowing which of these cases is tripping up the WPEngine tool. Item 2 would only happen if you were using a specific kind of plugin/customization. 1 would only happen if viewing the friends page of a user with a huge number of friends. 3 would happen only if viewing the members page of a group with a huge number of members. 3 is probably the most common, but if you could verify, it would help us to narrow things down.

    It’s hard to give a simple workaround for this kind of issue. One is to prevent BP from doing this specific ‘count’ query. This will have the effect of breaking certain kinds of pagination, but it may be something that you can work around, depending on the details. Fundamentally, this might count as a bug that should be fixed in BP – we may consider switching this to a subquery to avoid this kind of host restriction.

    In the meantime, you might consider reaching out to WP Engine and explaining this problem. In my experience, they’re generally pretty reasonable about disabling or loosening this query-length restriction in certain cases.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar