Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/kenzz55/ue5-iocp-mmo-server/llms.txt

Use this file to discover all available pages before exploring further.

The GameServer exposes a Prometheus text-format metrics endpoint at http://localhost:9108/metrics and a liveness check at http://localhost:9108/health. A pre-configured Docker Compose stack in ServerSolution/Infra/ pairs Prometheus (scraping every 5 seconds) with Grafana, which auto-provisions the MMO / MMO GameServer Overview dashboard on startup.

MetricsHttpServer

The HTTP server is controlled by two constants in Config.h:
constexpr bool EnablePrometheusEndpoint = true;
constexpr uint16 PrometheusHttpPort     = 9108;
When EnablePrometheusEndpoint is true the server starts a lightweight single-threaded TCP listener on PrometheusHttpPort before the IOCP loop begins. The two endpoints it serves are:
PathMethodDescription
/metricsGETPrometheus text format — all NetworkMetrics::Snapshot fields
/healthGETReturns 200 OK with body ok

Verify the endpoint

Invoke-WebRequest -UseBasicParsing http://localhost:9108/health
Invoke-WebRequest -UseBasicParsing http://localhost:9108/metrics

Starting the monitoring stack

1

Build and start the GameServer

Make sure the GameServer process is running before starting the containers. The Prometheus scrape job targets host.docker.internal:9108, so the endpoint must be reachable from Docker.
2

Set the Grafana admin password

The GRAFANA_ADMIN_PASSWORD variable is required by the Compose file — it has no built-in default in production mode.
$env:GRAFANA_ADMIN_PASSWORD = "your-password"
3

Start Prometheus and Grafana

Run the following from the ServerSolution/Infra/ directory:
cd ServerSolution\Infra
docker compose up -d prometheus grafana
The Compose file pins exact image versions (prom/prometheus:v3.13.0, grafana/grafana:13.1.1) and mounts the provisioning files as read-only volumes so the dashboard is always present on a clean start.
4

Open the dashboards

ServiceURL
Prometheus targetshttp://localhost:9090/targets
Grafanahttp://localhost:3000
Log in to Grafana with user admin and the password set above. The MMO / MMO GameServer Overview dashboard is pre-loaded in the MMO folder.

NetworkMetrics.Snapshot fields

The /metrics response is derived from NetworkMetrics::Snapshot. The fields are grouped below by subsystem.
FieldDescription
connectedSessionsTotal TCP sessions currently connected
authenticatedSessionsSessions that have completed login
udpBoundSessionsSessions that have completed UDP hello handshake
FieldDescription
recvBytesCumulative bytes received over TCP
recvPacketsCumulative TCP packets received
recvPayloadCopyBytesCumulative bytes copied when reading TCP payloads
sendPacketsCumulative TCP packets sent
sendPayloadCopyBytesCumulative bytes copied when building TCP send payloads
sendCallsNumber of WSASend calls made
scatterGatherSendCallsWSASend calls that used scatter-gather buffers
FieldDescription
udpRecvPacketsCumulative UDP datagrams received
udpRecvBytesCumulative UDP bytes received
udpSendPacketsCumulative UDP datagrams sent
udpSendBytesCumulative UDP bytes sent
udpSendFailuresUDP send calls that returned an error
FieldDescription
moveReqReceivedC_MoveReq UDP packets received
moveCommandsQueuedCommands enqueued to the simulation queue
moveCommandsDroppedCommands dropped because the queue was full
moveCommandsAppliedCommands processed by the simulation tick
moveCommandsStaleCommands discarded because a newer input arrived first
moveNotifyPacketsS_MoveNotify packets sent
moveNotifyRecipientsTotal recipient count across all notify packets
movementBatchPacketsS_MoveBatchNotify packets sent
movementBatchEntriesTotal entries across all batch notify packets
FieldDescription
movementReplicationPublishedPosition snapshots published to the replication buffer
movementReplicationReplacedSnapshots overwritten in the buffer by a newer position before dispatch
movementReplicationDroppedSnapshots dropped from the replication buffer
movementReplicationDispatchedSnapshots dispatched to clients in a replication cycle
movementReplicationCyclesTotal replication cycles completed
movementReplicationCycleTotalMicrosCumulative microseconds spent in replication cycles
movementReplicationCycleMaxMicrosSlowest single replication cycle in microseconds
movementReplicationPendingSnapshots currently waiting to be dispatched
movementReplicationPendingMaxPeak pending snapshot count observed
movementReplicationWorkSamplesNumber of replication work-phase samples recorded
movementReplicationGatherTotalMicrosCumulative microseconds spent gathering snapshots
movementReplicationGatherMaxMicrosSlowest single gather phase in microseconds
movementReplicationSendTotalMicrosCumulative microseconds spent sending replication datagrams
movementReplicationSendMaxMicrosSlowest single send phase in microseconds
movementReplicationAoiTotalMicrosCumulative microseconds spent on AoI queries during replication
movementReplicationAoiMaxMicrosSlowest single AoI phase in microseconds
movementReplicationVisibilityTotalMicrosCumulative microseconds spent on visibility checks
movementReplicationVisibilityMaxMicrosSlowest single visibility phase in microseconds
movementReplicationBatchBuildTotalMicrosCumulative microseconds building batch notify datagrams
movementReplicationBatchBuildMaxMicrosSlowest single batch-build phase in microseconds
FieldDescription
gameSimulationTicksNumber of simulation ticks completed
gameSimulationOverBudgetTicksTicks that exceeded the 33 ms budget
gameSimulationTickTotalMicrosCumulative tick wall-clock time in microseconds
gameSimulationTickMaxMicrosSlowest single tick in microseconds
gameSimulationRuntime.missedTicksTicks skipped because the previous tick ran too long
gameSimulationRuntime.commandQueueDepthCommand queue depth at the last runtime sample
gameSimulationRuntime.commandQueueDepthMaxPeak command queue depth observed
gameSimulationRuntime.commandsDrainedCommands drained in the last simulation drain pass
gameSimulationRuntime.commandWaitSamplesNumber of command-wait latency samples recorded
gameSimulationRuntime.commandWaitTotalMicrosCumulative command wait time in microseconds
gameSimulationRuntime.commandWaitP95Micros95th-percentile command wait latency in microseconds
gameSimulationRuntime.commandWaitP99Micros99th-percentile command wait latency in microseconds
gameSimulationRuntime.commandWaitMaxMicrosMaximum command wait latency in microseconds
gameSimulationRuntime.drainBatchesNumber of drain batches executed
gameSimulationRuntime.drainTotalMicrosCumulative drain execution time in microseconds
gameSimulationRuntime.drainMaxMicrosSlowest single drain batch in microseconds
gameSimulationRuntime.tickTimingSamplesNumber of tick-lateness timing samples
gameSimulationRuntime.tickLatenessTotalMicrosCumulative tick lateness in microseconds
gameSimulationRuntime.tickLatenessMaxMicrosMaximum tick lateness in microseconds
gameSimulationPhaseSamples[*]Per-phase sample counts (CharacterStateSave, PlayerMovement, PlayerCombat, MonsterCombat, MonsterSimulation, MonsterNotifications)
gameSimulationPhaseTotalMicros[*]Per-phase cumulative time in microseconds
gameSimulationPhaseMaxMicros[*]Per-phase peak time in microseconds
FieldDescription
activeMoverSamplesNumber of active-mover count samples taken
activeMoverTotalSum of active-mover counts across all samples
activeMoverMaxPeak active-mover count observed
FieldDescription
jobQueuedSession jobs enqueued
jobDroppedSession jobs dropped because MaxSessionJobQueueSize (1024) was exceeded
FieldDescription
processCpuPercentProcess-level CPU utilisation (0–100 × core count)
processWorkingSetBytesWorking set (physical memory) of the process
processPrivateBytesPrivate committed memory
processHandleCountOpen OS handle count
processThreadCountActive thread count
FieldDescription
logDroppedLog events dropped because the async queue was full

CSV metrics log

In addition to the Prometheus endpoint, the server writes a rolling CSV log controlled by:
constexpr bool EnablePerfCsvLog        = true;
constexpr int  PerfLogIntervalSeconds  = 5;
constexpr const char* PerfCsvLogPath   = "Logs/perf_metrics.csv";
When EnablePerfCsvLog is true a new row is appended every 5 seconds. This file is the primary input for the PerformanceReport tool.
Watch gameSimulationOverBudgetTicks and gameSimulationRuntime.missedTicks as your primary at-a-glance health signals. A single non-zero missedTicks reading means the simulation loop fell a full 33 ms behind — investigate gameSimulationTickMaxMicros and per-phase timings first before tuning thread counts.
Docker Desktop’s Prometheus container reaches the Windows host via host.docker.internal:9108. If the Target shows DOWN on http://localhost:9090/targets, confirm that the GameServer is running and that Windows Firewall allows inbound TCP on port 9108.

Build docs developers (and LLMs) love