Skip to content
Lonca

Leaderboards: Lonca and Nakama on the same hardware.

We ran Lonca's leaderboard prototype and Nakama 3.42 side by side on the same five CPU cores, each with its full stack and a board of one million players. These are preliminary numbers from a development laptop. Here is all of it, including where Nakama is faster.

1.9 to 4.9 times the requests a second.

256 connections send requests back to back until the five cores are full. Each pair of bars is scaled to Lonca's figure for that operation.

  • Submit a score

    1.9×

    Lonca
    24,699req/s
    Nakama 3.42
    13,099req/s
  • Top 100 of a 1M-player board

    4.9×

    Lonca
    32,953req/s
    Nakama 3.42
    6,746req/s
  • Ranks around a player

    3.8×

    Lonca
    53,262req/s
    Nakama 3.42
    13,890req/s
  • Top 50 of a room board

    3.6×

    Lonca
    43,459req/s
    Nakama 3.42
    12,068req/s
  • Match end: submit and two reads

    3.2×

    Lonca
    10,882matches/s
    Nakama 3.42
    3,373matches/s

Response times at a steady rate.

Requests arrive at a fixed rate, the way players send them, and we record how long each one takes. Lonca's writes stay under 8 ms at the 99th percentile. Nakama's reach 31 to 193 ms at 1,000 requests a second and above, because every write waits for a database disk sync.

Response time at 5,000 requests a second: median / 99th percentile, in ms. The faster median is in bold.

  • Submit a score

    Lonca
    0.69 / 6.9
    Nakama 3.42
    2.36 / 31
  • Top 100 of a 1M-player board

    Lonca
    1.15 / 5.8
    Nakama 3.42
    2.80 / 63
  • Ranks around a player

    Lonca
    1.35 / 6.0
    Nakama 3.42
    0.63 / 4.3
  • Top 50 of a room board

    Lonca
    1.06 / 5.2
    Nakama 3.42
    0.58 / 4.4
  • Match end: submit and two readsat 1,000 matches a second

    Lonca
    1.83 / 5.9
    Nakama 3.42
    2.83 / 193

Nakama answers small reads faster at the median on this laptop. There, a health check that does no work at all takes longer than either system's real reads, so these medians mostly show how busy the virtual machine is. We will settle them on Linux servers. On writes the gap goes the other way: every Nakama write waits for a database disk sync.

Response time at 1,000 requests a second: median / 99th percentile, in ms. The faster median is in bold.

  • Submit a score

    Lonca
    1.62 / 5.5
    Nakama 3.42
    2.62 / 169
  • Top 100 of a 1M-player board

    Lonca
    1.78 / 6.4
    Nakama 3.42
    1.79 / 6.5
  • Ranks around a player

    Lonca
    1.67 / 5.6
    Nakama 3.42
    1.57 / 6.1
  • Top 50 of a room board

    Lonca
    1.63 / 5.9
    Nakama 3.42
    1.74 / 6.4
  • Match end: submit and two readsat 300 matches a second

    Lonca
    2.74 / 7.6
    Nakama 3.42
    4.11 / 12

What we ran

Hardware
One laptop (Apple M4) running a 4 GiB Linux VM. Each system ran alone on the same five virtual CPUs; the load generator had the other five.
Nakama
Nakama 3.42.0 with Postgres 18, default configuration apart from token expiry and the metrics port.
Lonca
The leaderboard prototype: a Go API, Valkey, NATS JetStream with three replicas, and a worker that writes every score to Postgres 18. All of it shared the same five CPUs.
Postgres
The same configuration file on both sides, sized for the VM (512 MB of shared buffers).
Data
100,000 players, a global board of 1,000,000 entries and 10,000 room boards of 50. Both sides return rank, player, display name, score and time.
Durability
Lonca confirms a score once two of three JetStream replicas have stored it. Nakama confirms it after a Postgres commit with synchronous commit on.
Runs
Three rounds, medians reported. Each run: 5 s warm-up, 20 s measured. 180 runs, none with an error.

The five operations

Submit a score
A player submits a score: 80% go to room boards, the rest to the global board.
Top 100 of a 1M-player board
The first 100 entries of the 1,000,000-entry board.
Ranks around a player
Five entries above and five below a player on the 1,000,000-entry board.
Top 50 of a room board
All 50 entries of a room board.
Match end: submit and two reads
What a game sends when a match ends: a score, then reads of the room board and the player's neighbours. Counted in matches a second.

Limits of this run

Read the ratios more than the absolute numbers, and keep these in mind before quoting them.

A laptop, not a server
Virtual CPUs move between the laptop's fast and efficient cores, and disk syncs on the VM's virtual disk are slow, which hurts Nakama's writes more than they would on a server disk.
Small-read medians don't measure the servers here
At 5,000 requests a second, a health check that does no work at all takes 1.2 to 1.6 ms, longer than either system's real reads. The median mostly shows how busy the VM is.
One machine for all replicas
Lonca's three JetStream replicas ran on the same VM. On separate machines, as in production, every write also pays network time.
A prototype of one path
Lonca's side is the leaderboard path only, with the board layout from its spec. Some parts are simplified: player profiles were always cached, so a cold profile never cost a database read.
Synthetic players
Most board entries belong to synthetic players without a display name, on both systems. Looking up their names costs the same as for real players.
Run order
Lonca's numbers come from runs right after the joint run, in the same session, rather than interleaved with Nakama's. Nakama's numbers varied by under 4% between rounds.

Next, we will repeat the run on identical Linux servers with local NVMe disks.

Building a game with leaderboards?

Join the waitlist and we'll write to you personally before early access opens. Or book an early access call and we'll walk through your game's boards and traffic together.

  • SDKs for Unity, Godot and web games.
  • Open source: Lonca Cloud or self-hosted.
  • Built for casual and mobile games with live ops on day one.
  • A founder answers every signup.