Skip to:
Content
Pages
Categories
Search
Top
Bottom

Buddypress with large scale users


  • Fazlur Khan
    Participant

    @frkhan

    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 27.147.203.28:32469]
    KILLED QUERY (35690 characters long generated in
    /nas/content/staging/sued2/wp-content/plugins
    /buddypress/bp-core/classes/class-bp-user-query.php:536):
    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
    Keymaster

    @boonebgorges

    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: https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-core/classes/class-bp-user-query.php?marks=389#L382

    2. When joining against the user meta table because of some sort of meta_query: https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-core/classes/class-bp-user-query.php?marks=455#L430

    3. When parsing the include parameter, which can be populated by a plugin or by a group member query: https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-core/classes/class-bp-user-query.php?marks=373#L360

    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