Slowness of input/userpicker on Elgg 3.3.15

I have two dev servers with the same CPU cores/speed and number of RAMs. One is running on Elgg 2.3.7 and another on Elgg 3.3.15. MySQL configurations (max_connection, buffer_size, etc.) are the same. Database size of these two servers is very identical. I have noticed that userpicker on Elgg 2.3.7 (< 100 ms) is much faster than Elgg 3.3.15 (> 2 seconds). I am wondering if anyone has similar experience about userpicker. Or anything I missed on tuning the performance here?


  • In Elgg 2.3 the livesearch (used by the userpicker) was more or less an elgg_get_entities() query. In Elgg 3.3 the livesearch was changed to use elgg_search().

    elgg_search has more hooks and thus other plugins could change how it works. If you don't have any plugins that change the search behavior than it still is an elgg_get_entities() query, but because of changes to the database the query can be more complex.

    The size of the metadata table has an impact on the performance of the search queries.

    If you enable DEBUG logging you can get the SQL query related to your userpicker query, you could than try to find out if the problem is the database or the webserver. If the database takes up most of the response time than you could look into whats wrong there.

    Please note, both Elgg 2.x and 3.x are end-of-life ;)

  • Thank you Jerome for the explanation.

    That makes sense. I have several plugins that have their own search and they might change the search behavior as you mentioned.

    Also, thanks for the trick on debugging SQL query.

    I know that I am 2-3 versions behind :)

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking