discourse / discourse/message_bus

Readme Improvment regarding concurrent requests

Open
#201 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.7k
Forks
129
Avg merge
40m
Merged PRs (30d)
1

Description

"But will it scale?" is an important concern for everyone that considers this gem, since ActionCable itself is pretty bad (unfortunately) when we hit thousands of subscribers (as AnyCable benchmarks shows).

Right at the beginning of the readme it states that "MessageBus can handle thousands of concurrent long polls on all popular Ruby webservers", but I wish to improve it with some numbers so we can have a ballpark idea of how many concurrent connections it could actually handle.

And honestly I'm ignorant on how exactly that can be done! If it uses (by default) a long-polling stategy with streaming which keeps "the connection open for the configured long-polling interval (25 seconds by default)" (I'm quoting from the README), doesn't it mean that for every subscriber there will be an open connection that remains open all the time?

If you have a Puma server with 5 threads and 2 workers, can't it only handle 10 concurrent requests? By "the connections remain open during the long poll intervall" I assumed that thread would not be available for responding to any other requests (like, for instance, if it was a regular rails request that took very long to respond - the thread is stuck until that request finishes).

I commit myself to make a pull request to improve the readme on this part, but of course I need to understand how this works first :)

(I read the how it works section, but couldn't find these answers there).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README’s opening scalability claim and its “how it works” section, then investigate how the default long-polling and streaming behavior uses Ruby/Rack server threads and workers. Document supported concurrency figures and clarify whether long-polling connections prevent Puma workers from serving other requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.