Skip to content

Page unresponsive on 10K Socket Connections #22

Closed

Description

@vishwassingh47

Page is not responsive when when large number of sockets are connected (~10K).

Have tested in 2 scenarios:

  1. Start SocketIO server,Open Admin UI Page, now add load 10K socket connections in realtime, 10K connections are instantly connected on the server but Admin UI Page couldn't keep up with the real count.It then became unresponsive as it is with flooded with realtime docket data.

  2. Start SocketIO server,add load 10K socket connections,now open Admin UI,it will take long to connect and then page became unresponsive.

Screenshot from 2021-07-07 00-05-10

Activity

  1. darrachequesne commented on Jul 6, 2021

    @darrachequesne
    Member

    Yes, that's a lot of updates for the UI, which makes it unsuitable for more than a thousand connections.

    We could add a lazy mode, where specific sockets/rooms are not tracked. WDYT?

  2. vishwassingh47 commented on Jul 9, 2021

    @vishwassingh47
    Author

    Yes instead of broadcasting each and every events, we could make it lazy loaded or support batch operations.
    That way it can handle Very Large Number of connections.

  3. md-seb commented on Aug 5, 2021

    @md-seb

    Yes, that's a lot of updates for the UI, which makes it unsuitable for more than a thousand connections.

    We could add a lazy mode, where specific sockets/rooms are not tracked. WDYT?

    I think the server should not push, but client should pull instead, whenever the UI thinks it's ready. Updating every 2 secs is perhaps too fast anyway - items are jumping around too fast on screen when there's a lot of activity. Maybe 5 seconds would be better as a minimum?

    Here's my idea for lazy mode. I call it the Adaptive Refresh.
    Configure minRefresh speed to e.g. 5000ms and refreshRatio to e.g. 1.2
    UI sends a refresh request to the server and measures the roundtrip
    UI refreshes screen
    UI creates setTimeout for the next refresh to be Math.min(roundtrip*refreshRatio, minRefresh)

    This should solve the following issues:
    Fix the original issue where the overwhelmed UI crashes.
    Self-adapt to server load, because server fetching updates from cluster and/or Redis are async, and can take a while.
    Self-adapt to response size, depending on WebSocket activity.

  4. hatemragab commented on Feb 18, 2022

    @hatemragab

    Are any updates about this issue?

  5. added a commit that references this issue on Jun 21, 2022
  6. darrachequesne commented on Jun 23, 2022

    @darrachequesne
    Member

    For future readers:

    You can now use the production model, which was implemented in e0d91ca and included in version 0.4.0.

    In this mode, the server send fewer data to the admin UI, so it is suitable for a bigger workload.

    Please reopen if needed!

  7. added this to the 0.4.0 milestone on Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions