By Maryna Poplavska, Lead Project Manager · Last updated 19 November 2026
Virtual classroom architecture is the split between three planes: the media plane (the SFU carrying audio and video), the classroom-state plane (whiteboard, hand-raise, polls, roster) and the control plane (rooms, permissions, breakouts, recording). The media plane decides how many students a node can carry. The state plane decides whether the lesson still works when someone joins late, drops, or splits into groups. This guide assumes you have already chosen an SFU (if not, see our SFU vs MCU vs P2P comparison); for the topology by class size and the latency budget, start with our low-latency virtual classroom guide.
Key takeaways
- Size for the timetable, not the class. One class of 30 is small next to the vendors’ load tests; 40 classes starting at 9:00 is not. By default, the SFUs we checked place each room on one node or worker.
- Count consumers first. A consumer is one stream forwarded to one receiver: 1,740 for a class of 30 in gallery view, 116 teacher-centered. Our lab is a lower bound, so measure with real browser receivers and your own media.
- Breakouts cost the SFU far less than a full gallery. The added work is orchestration.
- The whiteboard is state, not video. Late joiners need a defined catch-up path: snapshot plus log, or a CRDT state exchange.
- Anything that must survive a refresh (board, attendance, breakout assignments, recording link) belongs on your backend, not in the SFU.
Scoping a build rather than writing code? Read what to ask your team before you budget and what our builds have shown. Engineers: start at sizing.
What are the layers of a virtual classroom, and how does each one fail?

| Plane | Carries | Lives on | What the teacher sees when it fails |
|---|---|---|---|
| Media | Audio, video, screen share | The SFU | Frozen tiles, robotic audio, a student nobody can hear |
| Classroom state | Whiteboard, hand-raise, polls, chat | A real-time state service: WebSocket server or real-time database | The board shows old drawings; a raised hand never appears |
| Control | Rooms, roles, permissions, breakout assignments, recording | Your backend | Students stuck in a breakout; a recording attached to the wrong lesson |
The planes fail independently, so “the video works” is not the same as “the lesson works”. Our view: give each plane its own reconnect path, because a student who refreshes needs all three back, in the right room.
How do you size an SFU for a virtual classroom?
Count consumers, then bandwidth, then classes starting in the same minute.
How many streams does a class of 30 actually create?
mediasoup’s API documentation defines a consumer as “an audio or video source being forwarded from a mediasoup router to an endpoint”. Its scalability page works through a room of 4 peers that all send and receive audio and video: each peer receives from 3 peers, “so 3×2 = 6 consumers”, and “4×6 = 24 consumers in total”. Scaled to 1 teacher and 29 students, each publishing one audio and one video track:

| View mode | Who receives what | Consumers |
|---|---|---|
| Gallery: everyone sees and hears everyone | 30 × 29 × 2 | 1,740 |
| Teacher-centered: students receive the teacher; the teacher sees every student | 29 × 2 + 29 × 2 | 116 |
| Breakouts: 6 rooms of 5, teacher in one of them, gallery inside each | 6 × (5 × 4 × 2) | 240 |
In a gallery room of N people, consumers = N × (N − 1) × 2, so they grow with the square of class size; teacher-centered view grows linearly. No screen share or simulcast is modeled. In product terms, a lecture is teacher-centered, a seminar is a capped gallery and group work is breakouts; a 30-tile gallery is cheap to specify and expensive to run.
What does one node carry?
Each SFU’s own answer, with its conditions (docs read 19 November 2026):
- mediasoup: “Depending on the host CPU capabilities, a mediasoup C++ subprocess can typically handle over ~500 consumers in total.” A worker “runs in a single CPU core” and “a router belongs to a worker”, so one room on one router shares one core unless you connect routers with
pipeToRouter(); across hosts, “mediasoup does not provide any signaling protocol”. - LiveKit: its self-hosting benchmark page reports, on a 16-core Google Cloud
c2-standard-16, 150 publishers with 150 subscribers at 85% CPU, and 1 publisher with 3,000 subscribers at 92%. Publishers sent “looping video clips at 720p, with keyframes every ~3s (simulcast enabled)”; subscribers simulated adaptive stream. “However, each room must fit within a single node.” - Jitsi Videobridge: the Jitsi handbook says bridges scale “horizontally by adding as many as needed” and “When a new conference starts, Jicofo picks a videobridge and schedules the conference on it.” It gives no per-bridge participant figure.
These are synthetic vendor load tests, not classroom measurements; none means “a node holds N students”.
What our own test adds, and what it can’t tell you. On 4 November 2026 we ran mediasoup 3.30.1 (one worker, VP8 and Opus) on an Apple M3 Mac (macOS arm64, not a Linux cloud vCPU). One headless Chrome 156 page hosted all 30 publisher connections, each sending one encoding (no simulcast) of audio and synthetic 320×180 video at 15 fps, capped at 200 kbps, on the same machine as the worker and the viewers’ UDP sink. Viewers were SRTP PlainTransports, not browsers: no decoding, no receiver reports, NACK, PLI or bandwidth-estimation feedback, no loss. So the figure is forwarding plus encryption for one light stream shape: a lower bound, not capacity. Worker CPU as a fraction of one core, over 30 seconds, two usable runs:
| Mode | Consumers | Worker CPU, two runs |
|---|---|---|
| Publishers only | 0 | 0.041 / 0.039 |
| Teacher-centered class of 30 | 116 | 0.095 / 0.089 |
| One gallery room of 10 | 180 | 0.103 / 0.099 |
| Breakouts, 6 rooms of 5 (teacher in one) | 240 | 0.128 / 0.124 |
| Gallery class of 30 | 1,740 | 0.365 / 0.316 |
In our test:
- Teacher-centered was cheap; gallery was not: about 0.09 of a core against 0.32–0.37 (baseline about 0.04). Sink traffic didn’t replicate between runs for the large gallery, so read that figure as indicative.
- Breakouts cost about the same as one gallery room of 10, roughly 0.10–0.12. Two runs can’t rank them against teacher-centered.
- Cost per consumer fell as consumers grew, from about 0.00045 to 0.00017 of a core net of baseline. We didn’t isolate why. This rig carried far more than mediasoup’s typical “~500 consumers”; that describes the rig, not production.
Bandwidth is the other budget line. Egress is the sum of what every consumer receives. Illustrative arithmetic, assumptions to replace: teacher-centered, 29 students receiving the teacher at 1 Mbps plus the teacher receiving 29 tiles at 150 kbps is about 33 Mbps of video per class; gallery, 870 video consumers at 150 kbps, about 131 Mbps. That is bandwidth, not a CPU rule: our test did not establish how bitrate affects SFU CPU.
Why is the timetable, not the class, the sizing unit?
By default, all three SFUs place a room whole: one mediasoup router unless you pipe routers, one LiveKit node (per its self-hosting benchmark page), one Jitsi bridge. Jitsi cascading is opt-in: its relay documentation says “Octo needs to be enabled”. We didn’t check Janus or Pion-based servers. So capacity planning is packing: how many rooms of which shape start at once.
A worked example, arithmetic only, not capacity: 40 classes of 30 start at 9:00, teacher-centered, so 40 × 116 = 4,640 consumers. At mediasoup’s typical ~500 per worker, that is about 9.3 workers; straight extrapolation of our lab’s teacher-centered figure (about 0.09 of a core per class) gives about 3.6 cores. Budget on the cautious figure until you’ve measured with real browser receivers. Egress at the bitrates above is about 1.3 Gbps (40 × 33 Mbps), before headroom, recording, screen share or any class switching to gallery. Our view: every connection setup and first key frame lands in that minute, so load-test that minute, not the average hour. For the bill, see what WebRTC infrastructure costs at scale.
What should you cap before you add hardware?
- Hidden tiles. Forward the speaker and a page of tiles. mediasoup’s
consumer.pause()means “no RTP is sent to the consuming endpoint”: it saves egress, but (our reading) the publisher keeps uploading. LiveKit’s Dynacast “automatically pauses video layer publications when they aren’t being consumed by subscribers”, so the upload stops too. - Muted microphones. 870 of a gallery’s 1,740 consumers are audio. mediasoup’s
producer.pause()means “no RTP is sent to its associated consumers”, so pausing a muted student’s producer stops all their audio consumers at once. - Small-tile layers. With simulcast, mediasoup’s
setPreferredLayers()sets “the preferred (highest) spatial and temporal layers” per consumer. - The student’s device. In our decode test (one Chrome 156 page on the M3, one source cloned 29 times, encoders in the same page), decoding 29 tiles took about 0.09 of a core at 320×180 and 0.21 at 640×360, no dropped frames. That is decode time only; rendering is extra. Chromebooks and older phones weren’t tested: test your weakest device.
Want these numbers run against your own class types and timetable? That is what we pressure-test in a free 30-minute architecture call with our e-learning and virtual classroom development team.
How should breakout rooms work on an SFU?
A breakout is a separate room with its own lifecycle: created, filled, timed, recalled, closed. The hard part is the control plane: who goes where, how they move, how a dropped student gets back.

Do breakout rooms add media load?
Our low-latency virtual classroom guide says breakout groups “add their own load”. Against a full gallery they cut it: 240 consumers against 1,740, and in our test about 0.12 of a core against 0.32–0.37. Against teacher-centered they add consumers (240 against 116); two runs can’t rank the CPU difference. Small rooms can also spread across workers, which one 30-person gallery can’t without piping. What always grows is orchestration: rooms, tokens, timers, per-room recording, and 30 students re-joining at once, each with a fresh connection setup (engineering reasoning).
Move participants, or have them re-join?
From each project’s docs (read 19 November 2026; not a recommendation):
| Approach | What the docs say | What you still own |
|---|---|---|
| Jitsi Meet built-in breakouts | IFrame API commands addBreakoutRoom, autoAssignToBreakoutRooms, sendParticipantToRoom and closeBreakoutRoom (“Closes the breakout room and sends participants to the main room”); each “can only be executed by the meeting moderator”. |
Where assignments live, and which room a refresh returns the student to |
LiveKit MoveParticipant |
Moves a participant “from one room to a different room”; needs the roomAdmin grant. “This feature is only available in LiveKit Cloud.” |
On self-hosted LiveKit, the re-join path below |
| Your own rooms, any SFU | mediasoup gives you routers, not classrooms; signaling is yours (above) | Room state, a token per room, and the move itself: the client leaves one room and joins another |
What breaks in practice?
Design cautions, not measurements:
- The visiting teacher should subscribe to one room at a time. On LiveKit, a hidden participant is “not visible to other participants in the room”.
- Recall during a reconnect. The timer fires while a student is mid-reconnect; the backend, not the client, decides which room they land in.
- Refresh inside a breakout. The student should come back to the breakout, not the main room, so store the assignment server-side: the SFU only knows who is connected, not who belongs where.
How do you keep a shared whiteboard in sync for every student, including late joiners?
Treat the board as a document: every stroke, shape or erase is an operation. In the server-authoritative design, one service orders operations into a log and periodically snapshots it; a late or reconnecting client loads the snapshot and catches up on the log.

Which transport?
Our default (engineering reasoning): a WebSocket server or real-time database, unless you accept the board sharing a failure domain with the media. A WebRTC data channel rides the call’s ICE and DTLS connection, so a media reconnect takes the board with it. Our event and webinar platforms kept real-time state on Firebase, apart from the Jitsi media path.
Either way (engineering reasoning, apart from the RFC quotes):
- Order is the server’s job. RFC 8831 carries data channels over SCTP, “encapsulated in DTLS”, and “A user message can be sent ordered or unordered”, but that order holds within one channel. One order across everyone who draws needs a server-assigned sequence number per board.
- Two traffic classes. Cursors and stroke previews can be lossy; committed operations must be reliable and logged.
- Snapshots over HTTP. And if a data channel ends at the SFU, your backend still has to receive every operation to persist it.
Server-authoritative or CRDT?
Two models, in each project’s own words, not ranked:
- Server-authoritative. In tldraw’s sync documentation (last edited July 2024), the server’s
TLSocketRoom“stores the authoritative copy of the document” and relays changes over WebSockets, and there must be “only ever oneTLSocketRoomglobally for each room in your app”. - CRDT. Yjs calls itself “a high-performance CRDT” that “doesn’t need a central source of truth”: “The order in which document updates are applied doesn’t matter.”
By analogy (ours, not tldraw’s), that is the media rule again: each breakout room needs a home on both planes, created and closed together.
Late join, reconnect, permissions, persistence
In the server-authoritative design (engineering reasoning):
- Late join, in this order: subscribe to live operations and buffer them; fetch the snapshot, which carries its sequence number N; drop buffered operations numbered N or lower and apply the rest. Any other order loses or double-applies operations.
- Reconnect: resume from the last sequence number seen; make operations idempotent or deduplicate them.
- Permissions: enforce who may draw on the server, not only in the UI.
- Persistence: store the final board with the session, next to the recording and the course module.
With a CRDT such as Yjs, reconnect is a state-vector exchange: per its document-updates docs, clients swap state vectors and send only the missing differences. A relay that doesn’t interpret updates can’t enforce who may draw, so that needs its own validation layer (engineering reasoning). And merging updates “doesn’t garbage-collect deleted content”, so plan compaction.
Which classroom state belongs on the SFU, and which on your backend?
The SFU carries media and, optionally, data channels. Your backend owns everything that must outlive a connection: roster and roles (usually from the LMS that launches the class), permissions, attendance, board snapshots, breakout assignments and the recording index.
Engagement features need limits by design. On our education webinar platform, 300 engaged learners can generate enough chat, Q&A and poll traffic to overwhelm the UI and backend, so the team built “rate limiting, message queuing, and moderation controls into the engagement layer from day one”. For compliance and accessibility rules, see the compliance section of our low-latency virtual classroom guide.
What should you ask your team before you budget?
Five questions, before anyone writes a load test:
- How many classes start in the same minute?
- Which view mode does each class type use: lecture, seminar or group work?
- What bitrate does each stream carry, and so what is peak egress?
- Are breakouts recorded, room by room?
- What is the weakest student device you support?
Then ask any vendor, us included: where do breakout assignments and the board live when a student refreshes? Until you’ve measured, budget on the cautious compute figure and the peak egress.
What have our classroom builds shown about state and scale?
Our closest deliveries are an event platform and an education webinar platform on Jitsi Meet, which the Jitsi handbook says “uses Jitsi Videobridge”, the third SFU above:
- Bemyapp’s event platform: customized Jitsi Meet on AWS with “pre-warmed capacity for scheduled start times”, NestJS APIs for breakout room assignments, Firebase for real-time state, load-tested with hundreds of concurrent participants across multiple simultaneous sessions. Lesson: provision for the scheduled start, and keep state off the media path.
- An education webinar platform: the same stack, again with “pre-warmed capacity for scheduled events”, and polls, Q&A and hand-raise synchronized across hundreds of concurrent participants. Lesson: rate limiting and moderation from day one.
- Sirius, a music education platform serving 8,000+ educators (a platform total, not concurrent classes): split-screen teacher and student video with a shared whiteboard for annotations, on EasyRTC. Lesson: the board is part of the lesson interface.
- Stusan, a group telemedicine platform: whiteboards as in-call overlays sharing session context. Its lesson carries over: “Clinical tools must live inside the call, not beside it”.
- A corporate LMS: sessions launched from a course module, recordings attached, attendance tracked against the roster. Lesson: one server-side source of truth, so web and mobile agree.
The boundary: our production mediasoup work is a custom SFU for Cloudbreak’s real-time translation, not a classroom, and we don’t publish per-node capacity figures from any build, so the sizing here rests on vendor documentation and our lab.
Frequently asked questions
How many students can one SFU node handle in a virtual classroom? There is no single number. Count consumers per view mode and classes per start minute, then load-test with real browser receivers at the busiest start.
Do breakout rooms need extra media servers? Usually not for media: small rooms create fewer consumers than one big gallery. The added cost is orchestration and per-room recording.
Should the whiteboard use a WebRTC data channel or a WebSocket? A data channel shares the call’s connection, so a media reconnect takes the board with it. Our default is a WebSocket or real-time database, with server-assigned sequence numbers and snapshots over HTTP.
How do you handle a student who joins a class or a breakout late? Look up their room on the backend, connect them to it, then run the catch-up sequence above.
Can we use a ready-made classroom product instead of building this? Yes, when a configured product covers how you teach. Our vendor guide covers when buying beats building.
Sizing a new classroom platform, or fixing one that struggles at 9:00 on Monday? Book a free 30-minute call with a Trembit engineer from our WebRTC development team that works at the protocol level. Bring your class types, your peak number of concurrent classes and whether the board must be recorded, and we’ll work through the sizing and the breakout design with you. No deck, no pitch.