Performance and scaling
WebSpace can run static websites, data APIs, and real-time services together. Define data structures and permissions in a schema file (.sfn), then connect REST APIs and WebSocket under the same authentication system.
Verification with 5,000 real-time connections
Using the same Node WebSocket client and authentication and subscription procedure, each connection received 10 events. Each scale was measured three times.
| Concurrent connections | Delivered events | Best total completion | Average total completion | Connection p95 best / average | Delivery p95 best / average | Result |
|---|---|---|---|---|---|---|
| 100 | 1,000 | About 168 ms | About 176 ms | About 143 ms / 153 ms | About 19 ms / 20 ms | 0 missing |
| 1,000 | 10,000 | About 812 ms | About 952 ms | About 563 ms / 679 ms | About 211 ms / 220 ms | 0 missing |
| 5,000 | 50,000 | About 2.96 s | About 3.27 s | About 1.69 s / 1.86 s | About 1.08 s / 1.21 s | 0 missing |
Best is the shortest of three runs, and Average is the arithmetic mean. No event was lost in any run, even when connections and delivery volume increased 50-fold from 100 to 5,000.
Monster raid with actual writes
In addition to idle real-time connections, an SQLite3 scenario was tested in which multiple users attack a shared boss.
- 1,000 authenticated connections subscribe to the same game.
- The server evaluates 100 attacks and stores boss health, attack records, and rewards.
- The per-user item API is queried 1,000 times.
- Retransmitted attacks are checked to ensure they do not duplicate health changes or rewards.
| Item | Result |
|---|---|
| Game state and item writes | 100, 0 errors |
| Item API reads | 1,000, all successful |
| Read completion time | About 1.91 s |
The same structure can support real-time quizzes, shared growing activities, collaborative boards, production dashboards, and participatory campaigns. A common handler lets the server determine state changes and permissions without tying the design to one game.
Choosing an engine and scaling
| Workload | Recommended direction |
|---|---|
| Proof of concept, internal tool, single server | Start quickly with SQLite3 |
| Writes distributed across many rooms, resources, or users | PostgreSQL or MySQL/MariaDB |
| Multiple servers, replication, and specialized operations tools | Use an external database |
| Optimize WebSocket event delivery | Review room size, messages, and fan-out before changing the DB |
External databases help with distributed writes and multi-server operations, but changing the DB alone does not make real-time delivery faster by the same proportion.
Interpreting the results
These figures came from a single local development environment where builds and development work also ran. They are not an SLA or the maximum throughput of dedicated hardware, and they do not represent 5,000 distinct user accounts, internet transit, or a production proxy.
Actual capacity depends on server specifications, proxies, networking, message size, participants per room, and the read/write ratio. The default concurrent connection limit is a safe starting value of 1,000. For larger deployments, adjust the limit and load-test the production environment before release.
During operation, review requests, errors, response times, and DB status under Operations, and manage connection limits under Services and capacity.
To test a complete user flow, download the sample in Example: Build a real-time Gomoku game and play a match.