Fixed Members Online list does not scale well

Xon

Well-known member
The Members online list scales poorly as it is double handling the list of all online users.

This means no paging, getting all user details, and such. As the session online account increases, this can become quite prohibitively CPU wise as each PHP worker is processing the list instead of the database.

My optimized list queries add-on implements a partial fix, but it doesn't show the most recent users online. Just followed users and staff.

Viewing the index page:

With 1000 user online records with my tweaks:
Page Time: 0.1769s
Memory: 6.6866 MB (Peak: 8.1898 MB)

With 1000 user online records without my tweaks:
Page Time: 0.2589s
Memory: 12.8271 MB (Peak: 15.6650 MB)

With 2000 user online records with my tweaks:
Page Time: 0.2026s
Memory: 6.6975 MB (Peak: 8.2021 MB)

With 2000 user online records without my tweaks:
Page Time: 0.3206s
Memory: 19.3372 MB (Peak: 25.6656 MB)

With 6000 user online records with my tweaks:
Page Time: 0.2088s
Memory: 6.7152 MB (Peak: 8.2181 MB)

With 6000 user online records without my tweaks:
Page Time: 0.6554s
Memory: 46.0190 MB (Peak: 66.6412 MB)

The actual SQL performance difference is:

With 1000 user online records,
My Tweaks:
Run Time: 0.008862
XF stock:
Run Time: 0.008727

With 2000 user online records,
My Tweaks
Run Time: 0.015201
XF stock:
Run Time: 0.017363

With 6000 user online records,
My Tweaks
Run Time: 0.045867
XF stock:
Run Time: 0.055191
 
This is something that did come up once before so we are aware of it and intend on making changes in the future, but it's likely to change either backwards compatibility in the API and/or the information that's actually displayed, so this is something that will need to change in a future release (likely 2.0).
 
Technically there was another bug report for this, but the approach to this has changed in XF2 to scale better.
 
Back
Top Bottom