Skip to content

Aaliyah097/bochat

Repository files navigation

Scalable chat server

Scaling is achieved by using the Redis Stream mechanism.

It helps store websocket connections in redis memory and distribute is through different application replicas.

So the bottleneck of the system is Redis.

Performance indicators (estimated with 1 uvicorn worker):

RPS - requests (messages) per seconds (mean)
TTR, ms - time to response (mean)

  • 200 RPS = 5 TTR

alt text

Dependencies:

  • python 3.1*
  • FastAPI
  • asyncio
  • Redis
  • MongoDB
  • Firebase
  • Docker
  • docker-compose
  • hypercorn

alt text

Run:

docker-compose up -d