Skip to content

fix(bbb-graphql-middleware): share the Hasura balancer's connection counts between nginx workers - #26248

Merged
antobinary merged 1 commit into
bigbluebutton:v4.1.x-developfrom
tibroc:fix/hasura-lb-zone
Oct 30, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:v4.1.x-developfrom
tibroc:fix/hasura-lb-zone

Conversation

@tibroc

@tibroc tibroc commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Follows the question on #26217 about balancing over two Hasura instances.

The hasura upstream uses least_conn but has no zone, so each nginx worker keeps its own connection counts, and a worker that has no connections yet sends to the first server. Right after nginx starts or reloads (which is when a second instance gets added), connections mostly go to the first Hasura.

Test: nginx with this file and two websocket backends, a client opening N long-lived websockets one by one, fresh nginx before each run, 5 runs each (Ubuntu 24.04 nginx 1.24.0 and nginx 1.30.6, 22 and 24 workers):

  • without zone: N=12 → 12/0 in every run; N=40 → 32/8 (24 workers) and 30/10 (22 workers)
  • with zone hasura 64k; (the runs; the size does not change the balancing): N=12 → 6/6; N=40 → 20/20, every run

The same holds when the server is one name that resolves to two addresses. nginx -t passes on both versions. nginx needs at least 8 memory pages (32k with 4k pages); 512k also fits systems with 64k pages. The docs example in customize.md gets the same line, so copies keep it.

…ounts between nginx workers

Without a zone, each nginx worker keeps its own least_conn counts for the
hasura upstream, so a worker with no open connections picks the first
server. Right after an nginx start or reload, joins that land on different
workers mostly go to the first Hasura instance. With a shared zone the counts
are global and the connections are split evenly.

nginx needs a zone of at least 8 memory pages (32k with 4k pages); 512k
also fits systems with 64k pages.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 4
  • v3.0.x-release
  • v3.0.x-develop
  • v4.0.x-release
  • v4.0.x-develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d47fe008-3ce8-47c3-a5e5-4ea5b040fa8e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

⏳ Automated tests are running...

@antobinary
antobinary merged commit c90e70a into bigbluebutton:v4.1.x-develop Oct 30, 2026
72 of 77 checks passed
antobinary added a commit to antobinary/bigbluebutton that referenced this pull request Nov 3, 2026
v4.1.x-develop gained bigbluebutton#26219, bigbluebutton#26267, bigbluebutton#26217, bigbluebutton#26248, bigbluebutton#26348 and three
Dependabot image bumps since 9fffe59. They merge cleanly; the merge
is here so that the two commits that follow can change
bigbluebutton-web/Dockerfile and build-all-images.yml as those files
now are on 4.1.
@tibroc
tibroc deleted the fix/hasura-lb-zone branch November 26, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants