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 connectionsDelivered eventsBest total completionAverage total completionConnection p95 best / averageDelivery p95 best / averageResult
1001,000About 168 msAbout 176 msAbout 143 ms / 153 msAbout 19 ms / 20 ms0 missing
1,00010,000About 812 msAbout 952 msAbout 563 ms / 679 msAbout 211 ms / 220 ms0 missing
5,00050,000About 2.96 sAbout 3.27 sAbout 1.69 s / 1.86 sAbout 1.08 s / 1.21 s0 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. 1,000 authenticated connections subscribe to the same game.
  2. The server evaluates 100 attacks and stores boss health, attack records, and rewards.
  3. The per-user item API is queried 1,000 times.
  4. Retransmitted attacks are checked to ensure they do not duplicate health changes or rewards.
ItemResult
Game state and item writes100, 0 errors
Item API reads1,000, all successful
Read completion timeAbout 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

WorkloadRecommended direction
Proof of concept, internal tool, single serverStart quickly with SQLite3
Writes distributed across many rooms, resources, or usersPostgreSQL or MySQL/MariaDB
Multiple servers, replication, and specialized operations toolsUse an external database
Optimize WebSocket event deliveryReview 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.