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

feat: Load Balancer Implementation for WebRTC Servers #32

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gabrielmatau79
Copy link
Collaborator

@gabrielmatau79 gabrielmatau79 commented Jan 24, 2025

Resolve #21 Issue,

This Pull Request introduces the implementation of a load balancer service designed to manage WebRTC servers running mediasoup and includes a significant refactor to restructure the repository as a monorepo. The load balancer optimizes the distribution of room creation requests by tracking server load and maintaining an up-to-date registry of available servers. Key functionalities include server registration, load tracking, and room creation delegation.

  1. Server Registration:
  • Servers can register themselves via the /register endpoint.

  • Data stored for each server:

    • serverId: Unique identifier for the server.
    • url: Base URL of the server.
    • capacity: Maximum number of peers the server can handle.
  1. Room Creation Delegation:
  • A createRoom method determines the best server (based on current load) and delegates the room creation task.
  • The load balancer tracks the load of each server dynamically by calculating rooms / capacity.
    Load Tracking:

@gabrielmatau79 gabrielmatau79 self-assigned this Jan 24, 2025
@gabrielmatau79 gabrielmatau79 marked this pull request as ready for review January 30, 2025 18: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.

Support for Horizontal Scaling with Mediasoup Server
1 participant