Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converse/Prosody optimization: don't use vCards for avatars, but custom front-end code. #106

Closed
4 of 5 tasks
JohnXLivingston opened this issue Sep 21, 2022 · 2 comments
Closed
4 of 5 tasks
Labels
enhancement New feature or request Sponsor: NlNet Tasks that are sponsored by NlNet Type: Scalability
Milestone

Comments

@JohnXLivingston
Copy link
Owner

JohnXLivingston commented Sep 21, 2022

Is your feature request related to a problem? Please describe.
Displaying avatars for chat user currently use the XMPP vCards. This can induce a heavy load: each time a user joins, he will ask for all other users vCards. When hundreds of users join at the same time it can be an issue.
For people using the web interface, we could shortcut the XMPP server/vcards to directly get avatars from Peertube, and/or we should lazy-load them when they are actually displayed.

NlNet expert suggested to add some lazy loading for avatars. We could for example remove avatars from user list, and just load them when users are sending messages.

To avoid performance issue on very large rooms, @jcbrand suggest the following:
#95 (comment)

Describe the solution you'd like
Here is the solution I suggested (but better ideas have come up later on):
#95 (comment)

  • Design a test with several users joining at once
  • implement one of:
    • Customize ConverseJS to shortcut XMPP server for avatars
    • "Lazy load" avatars: don't load unnecessary avatars (when not visible, as when the occupant list is closed)
  • Run stress test and publish a report

Reference: NlNet-task-12

@JohnXLivingston JohnXLivingston self-assigned this Nov 18, 2022
@JohnXLivingston JohnXLivingston added enhancement New feature or request Searching Sponsor Issues that needs a funding to be done. labels Feb 9, 2023
@JohnXLivingston JohnXLivingston added Sponsor: NlNet Tasks that are sponsored by NlNet and removed Searching Sponsor Issues that needs a funding to be done. labels Jul 27, 2023
@JohnXLivingston JohnXLivingston modified the milestones: 2023-01, 2023-02 Jul 27, 2023
@JohnXLivingston JohnXLivingston removed their assignment Jul 27, 2023
@JohnXLivingston
Copy link
Owner Author

Here are some performance tests, concerning a first implementation test: https://github.com/JohnXLivingston/livechat-perf-test/tree/main/tests/40-dont-load-unecessary-vards

Needs more tweaking.

@JohnXLivingston
Copy link
Owner Author

Finally i didn't implement front-end avatar loading.
This could add some privacy issues:

  • if we make request to remote uri, an attacker could steal IP address
  • by default, MUC occupants JID are hidden (using occupant id instead) for non-moderator users, so querying avatars from the front-end could leak some data
  • this could implied various security issue with federation handling (as remote data can't be trusted)

So i only implemented a sort of lazy-loading: we don't load all vCards/avatars when the participant list is hidden (which is the case by default when you join a chat).

I also optimized Peertube user parallel loading (see #309).

So, to fix this issue, here are the involved commits:

And here some performance measurements:
https://github.com/JohnXLivingston/livechat-perf-test/tree/main/tests/40-dont-load-unecessary-vards#run-02

@github-project-automation github-project-automation bot moved this from In Progress to Done in Peertube plugin livechat Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Sponsor: NlNet Tasks that are sponsored by NlNet Type: Scalability
Projects
Development

No branches or pull requests

1 participant