Skip to content

NSLS2/test-redis-ws

Repository files navigation

Requirements

  • Podman 4.0+ or Docker
  • Podman-compose 1.0.6+ (for scaling support)
  • Pixi (for local development)

Quick Start

Option 1: Manual Setup

docker run --net=host --rm -v ./redis:/usr/local/etc/redis --name test-redis redis redis-server /usr/local/etc/redis/redis.conf

pixi run serve

Option 2: Docker Compose with Load Balancing

The project includes a Docker Compose configuration that sets up:

  • Redis server
  • 3 Streaming API instances (fixed configuration)
  • Traefik reverse proxy for load balancing

To start all services:

docker-compose up -d
# or with podman
podman-compose up -d

Accessing the Services

Testing Load Balancing

To verify load balancing is working, run this command to see requests distributed across different server instances:

for i in {1..20}; do curl -s -D - http://localhost:8000/stream/live 2>/dev/null | grep X-Server-Host; done | sort

About

Working toward Websockets in Tiled, with Redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •