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

Handling large number of topic subscriptions #402

Open
2 tasks
aschmahmann opened this issue Mar 2, 2021 · 9 comments
Open
2 tasks

Handling large number of topic subscriptions #402

aschmahmann opened this issue Mar 2, 2021 · 9 comments
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up

Comments

@aschmahmann
Copy link
Contributor

aschmahmann commented Mar 2, 2021

Currently if a node subscribes to enough topics such that the RPC that is used to send topic subscription announcements exceeds the maximum message size (defaults to 1MiB) then we'll silently fail and stop announcing any of our topics to newly connected peers.

We should more gracefully error, or inform the user, when they've exceeded the maximum number of topics they can subscribe to and additionally it'd be nice to have a mechanism in place to allow for a larger number of subscriptions.

  • (Beginner) Error when exceeding maximum topic limit
    • Easiest: Just check if the (hello packet) message size is too large and log an error
    • More correct: When subscribing to a new topic check if the new topic would force the hello packet to exceed the maximum size and if so return an error instead of allowing the topic to be subscribed to.
  • (Expert) Allow sending more topics than fit in a single message
@Stebalien
Copy link
Member

Ideally, we'd be able to send a HAMT or a bloom filter of topics.

@BigLep BigLep added this to Weekly Candidates in Maintenance Priorities - Go Mar 29, 2021
@BigLep BigLep linked a pull request Apr 6, 2021 that will close this issue
@BigLep BigLep unassigned vyzo May 5, 2021
@BigLep BigLep moved this from Weekly Candidates to In Progress in Maintenance Priorities - Go May 5, 2021
@BigLep
Copy link

BigLep commented May 5, 2021

@iand is working on this

@BigLep BigLep moved this from In Progress to In Review in Maintenance Priorities - Go May 16, 2021
@BigLep BigLep moved this from In Review to Weekly Candidates in Maintenance Priorities - Go May 17, 2021
@BigLep BigLep added P2 Medium: Good to have, but can wait until someone steps up exp/expert Having worked on the specific codebase is important labels May 17, 2021
@BigLep
Copy link

BigLep commented May 17, 2021

Beginner issue is to just get a proper error message.
This is back in the backlog.

@BigLep
Copy link

BigLep commented Aug 20, 2021

@aarshkshah1992 : for your rotation can you please take the error message at the minimum so that if this happens on Gateway we know about it?

@marten-seemann marten-seemann added the help wanted Seeking public contribution on this issue label Nov 12, 2021
@BigLep BigLep removed this from Weekly Candidates in Maintenance Priorities - Go Apr 26, 2022
@samlaf
Copy link

samlaf commented Sep 20, 2023

Is there a rough estimate of how many topics can be subscribed to using that 1MB limit?

@lthibault
Copy link
Contributor

@samlaf I'd expect that to be hardware and network dependent.

@samlaf
Copy link

samlaf commented Sep 20, 2023

@lthibault Oh then I really have a bad understanding of this issue. I was assuming this was just saying that each subscription takes some amount of bytes, which need to be packed inside 1MB?

@aschmahmann
Copy link
Contributor Author

aschmahmann commented Sep 20, 2023

@samlaf it's been a while since I wrote this issue and poked around in this codebase, but I think should be something like 1MiB/(sum of your topic name byte lengths + some overhead) and as a result it's a function of your topic names. i.e. you're encoding this

message RPC {
repeated SubOpts subscriptions = 1;
repeated Message publish = 2;
message SubOpts {
optional bool subscribe = 1; // subscribe or unsubcribe
optional string topicid = 2;
}
optional ControlMessage control = 3;
}
and sending it over the wire and it's got to be under the max size.

@lthibault
Copy link
Contributor

@samlaf As I understand it, the 1MB default limit pertains to the maximum size of messages transported over a pubsub topic. The maximum number of topics is therefore going to minimally depend on (1) network characteristics (2) available memory/cpu/etc of the machines, and (3) message transmission rate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants