Skip to content

okdaichi/qumo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

qumo

CI Go Report Card License

qumo is a Media over QUIC (MoQ) relay server and CDN implementation, providing high-performance media streaming over the QUIC transport protocol.

Features

  • πŸš€ High-performance media relay using QUIC
  • πŸ“‘ Support for Media over QUIC protocol
  • πŸ”’ Built-in TLS/security support
  • πŸ“Š Prometheus metrics for monitoring
  • βš™οΈ Flexible YAML-based configuration
  • 🐳 Docker support (coming soon)

Port Configuration

Standard Ports:

  • 6670/udp - QUIC/MoQT relay server
  • 8080/tcp - Health check & metrics HTTP endpoint
  • 5173/tcp - Web demo frontend (development only)

URLs:

  • Relay: https://localhost:6670
  • Health: http://localhost:8080/health
  • Web Demo: http://localhost:5173

Quick Start

Prerequisites

  • Go 1.21 or higher
  • Basic understanding of QUIC protocol

Installation

go install github.com/okdaichi/qumo/cmd/qumo-relay@latest

Building from Source

git clone https://github.com/okdaichi/qumo.git
cd qumo
go build -o bin/qumo-relay ./cmd/qumo-relay

Running the Relay

# Copy the example configuration
cp configs/config.example.yaml config.yaml

# Edit the configuration as needed
# vim config.yaml

# Run the relay server
./bin/qumo-relay --config config.yaml

Configuration

See configs/config.example.yaml for a complete configuration example with detailed comments.

Basic configuration structure:

server:
  address: "0.0.0.0:6670"
  cert_file: "certs/server.crt"
  key_file: "certs/server.key"
  health_check_addr: ":8080"

relay:
  upstream_url: ""           # Optional upstream server
  group_cache_size: 8        # Number of groups to cache
  frame_capacity: 1500       # Frame buffer size in bytes

Architecture

qumo implements a high-performance MOQT relay using:

  • Frame Pool: Zero-allocation frame reuse for optimal memory efficiency
  • Group Cache: Ring buffer-based caching with configurable size
  • Broadcast Pattern: Efficient subscriber notification with buffered channels
  • Concurrent Safety: Comprehensive mutex protection and atomic operations

Performance Optimizations

  • Frame pooling reduces GC pressure
  • Optimized 1ms notification timeout (based on benchmarks)
  • Lock-free operations where possible
  • Efficient ring buffer for group caching

Project Structure

qumo/
β”œβ”€β”€ cmd/
β”‚   └── qumo-relay/        # Main relay server application
β”œβ”€β”€ relay/                 # Core relay implementation
β”‚   β”œβ”€β”€ server.go          # MOQT server wrapper
β”‚   β”œβ”€β”€ handler.go         # Track relay handler
β”‚   β”œβ”€β”€ frame_pool.go      # Memory-efficient frame pooling
β”‚   β”œβ”€β”€ group_cache.go     # Ring buffer group cache
β”‚   β”œβ”€β”€ config.go          # Configuration structures
β”‚   └── health/            # Health check endpoints
β”œβ”€β”€ solid-deno/            # SolidJS web demo application
β”œβ”€β”€ configs/               # Configuration examples
β”œβ”€β”€ certs/                 # TLS certificates
β”œβ”€β”€ docs/                  # Documentation
└── README.md

Testing

qumo has comprehensive test coverage:

# Run all tests
go test ./...

# Run tests with coverage
go test -cover ./...

# Run with race detector
go test -race ./...

Documentation

Performance

Key performance characteristics:

  • Low Latency: 1ms notification timeout for optimal balance
  • Memory Efficient: Frame pooling prevents allocation overhead
  • Scalable: Tested with 1000+ concurrent subscribers
  • Concurrent: Thread-safe operations with minimal lock contention

Benchmarks (see relay/*_test.go):

  • Frame pool operations: ~0 allocations per Get/Put cycle
  • Broadcast to 1000 subscribers: <1ms
  • Group cache operations: Constant-time access

Development

Running Tests

# Run all tests
go test ./...

# Run tests with coverage
go test -coverprofile=coverage.out ./...

# Run tests with race detector
go test -race ./...

Linting

golangci-lint run

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Community

  • Discussions - Ask questions and discuss ideas
  • Issues - Report bugs and request features

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Acknowledgments

  • Media over QUIC (MoQ) Working Group
  • IETF QUIC Working Group

Status

⚠️ This project is under active development. APIs and features may change.

About

Implementation of MoQ-powered media relay

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages