Skip to content

[question]: Ping message published to redis vs. direct SSE #5

@iankirk99

Description

@iankirk99

Hi, I just started using this in production and have noticed a large number of publish commands being used even when not actively sending messages to clients (for my use case, I have a lot of concurrent users connected, but relatively few messages sent to each user).

It seems like this is mostly coming from the ping messages, which in my understanding gets sent to Redis every 10 seconds, then re-processed in the same handler in the onMessage function and forwarded to the client. I'm assuming that this is done to keep the client HTTP connection alive, but this creates an overhead of 6 publish commands per minute per active connection.

I'm wondering if this could be simplified by just sending ping messages directly to the client and avoiding Redis entirely. This should decrease idle load on Redis and the server (assuming there aren't other side effects that I'm missing here).

Happy to make the PR for this, but thought I'd check to make sure I'm not missing anything here first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions