libp2p / libp2p/go-libp2p-pubsub

Option to use variable length queue to avoid dropping message on burst

Open
#431 7 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

effort/days P3 status/ready
Dominant language
Go
Stars
364
Forks
221
PR merge metrics
No merged PRs in 30d

Description

There is in this package a bunch of pressure release mechanisms to avoid breaking or using too much memory when things get clogged under load. The downside is that pubsub can drop some messages under load, even if the message did find its way across the network. This makes sense most of the time.

There is at least 3 spots where that can happen:

  • validation queue (tunnable with pubsub.WithValidateQueueSize)
  • outbound queue (tunnable with pubsub.WithPeerOutboundQueueSize)
  • topic subscribe output queue (soon to be tunnable as well)

I believe some applications (like mine) would benefit from being able to tell pubsub to use as much memory as necessary and not drop messages in a heavy load scenario. Of course that mean that the application expose itself to being OOMed, but that can be easier to predict and handle than message semi-randomly disappearing.

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 by tracing the validation queue, outbound queue, and topic subscribe output queue, including the WithValidateQueueSize and WithPeerOutboundQueueSize options. Define how an option for retaining messages under burst load should apply across these pressure points, and verify that the configured behavior no longer drops messages while documenting the memory tradeoff.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.