Skip to content

Instantly share code, notes, and snippets.

View nemmarramos's full-sized avatar
🎯
Focusing

Nemmar Ramos nemmarramos

🎯
Focusing
  • Metro Manila, Philippines
  • 00:08 (UTC +08:00)
View GitHub Profile
@gurupras
gurupras / distributed-mediasoup.js
Created May 27, 2020 13:41
mediasoup horizontal scaling
onServerStartup () {
const { serverId, ip } = getServerInfo() // serverId does not change across restarts
this.serverId = serverId
// We don't have any routers or producers (yet). Clear any value that exists in the DB related to our serverId
clearSharedDB(serverId, 'routers')
clearSharedDB(serverId, 'producers')
// Update the DB with our serverId and ip so that others will know how to reach us
registerServerInDB(serverId, ip)