Session Host Service

The Session Host (started as a backend with webstream.exe -backend) is the private application server — the unit of compute that scales with concurrent sessions. It manages a pool of Windows RDP sessions, launches a Streamer inside each one, and registers itself with the Gateway so traffic can be routed to it.

Function

Ports and endpoints

ListenerPortPurpose
HTTPgateway.backend.advertisedUrl port (default 9005)Health checks, /getConnection, static web client. Port 9005 avoids conflicts: Gateway = 9000, Streamers = 9010/9020/…

In standalone Session Manager mode (-sm, without a gateway) the service also opens a /control WebSocket on basePortNumber (9000) and HTTP on 9001. Production deployments use -backend, where the gateway proxies WebSockets directly to streamers instead.

Message contracts

Outbound — to the Gateway

EndpointMethodFrequencyPayload
/gateway/registerPOSTStartup (after a local /health self-check; retried every 30 s, up to 10 times){ serverUrl, maxSessions, instanceType, ec2InstanceId, tags[], capabilities[], version }
/gateway/heartbeatPOSTEvery 10 s (config heartbeatInterval){ serverUrl, status, activeSessions, maxSessions, instanceType, tags[], cpuUsage, memoryUsage, timestamp }
/gateway/unregisterPOSTShutdown{ serverUrl }

Inbound — from the Gateway

EndpointMethodFrequencyPurpose / payload
/healthGETEvery 1–10 s (gateway health monitor)Returns { status, timestamp, sessions: { total, active, available }, uptime }.
/getConnectionGETPer workspace launch / reconnectRequires X-Session-ID; optional ?width=&height=. Allocates a pool session and returns the streamer connection details. Workspace context arrives in the injected X-Workspace-*, X-App-*, and X-Policy-JSON headers.
Static pathsGETPer page loadWeb client assets from serverHttpPath.

Local — Session Manager ↔ Streamer (WebSocket text protocol)

MessageDirectionWhen
REQUEST_SESSION_INFO:{username}Streamer → Session ManagerStreamer startup inside a new RDP session.
SESSION_INFO:{sessionUuid}|{commandLineParams}Session Manager → StreamerReply carrying the session identity and launch parameters.
FILE_UPLOAD_COMPLETE:{dialogGuid}|{filePath}Session Manager → StreamerNotifies a waiting headless file dialog that an upload has landed.

Session start queue

Starting a session is disk-intensive: profile, registry, and hive preparation followed by an RDP logon that loads NTUSER.DAT. Running several of these at once causes disk-IOPS contention that can thrash competing starts and destabilise sessions already running, so the start phase is strictly serialised through a gate with capacity fixed at 1 (by design, not configurable).

The queue is tuned by the optional <sessionStartQueue> element inside <webstreamSettings> in app.config.xml. If the element is missing, the defaults below apply.

PropertyDefaultPurpose
prepWatchdogSeconds120Maximum time one start may hold the gate before it is failed and the gate released. Clamped to a minimum of 30.
maxQueuedStarts10Maximum starts in the queue (including the one holding the gate); beyond this, launches return START_QUEUE_FULL. 0 = unlimited.
abandonSeconds30Cancel a queued start whose browser has not polled for this long. 0 = disabled.
settleSeconds5Hold the gate this long after a successful logon before the next start. Capped at 60.
Note

The start queue is per host. When the whole cluster has no free session slots, the Gateway answers new launches with capacity_reached instead of queuing them — and, where auto-scaling is configured, brings up another session host.

Configuration

PropertyPurpose
gateway.backend.gatewayUrlThe gateway to register with (HTTPS; the gateway terminates SSL).
gateway.backend.advertisedUrlThis host's own URL as the gateway should reach it (HTTP, private network, default port 9005).
gateway.backend.heartbeatIntervalHeartbeat period in seconds (default 10).
gateway.backend.maxSessionsSession capacity advertised to the gateway's load balancer.
webstreamSettings.serverMaxSessionCountSize of the local RDP session pool.
webstreamSettings.serverSessionUsername / serverSessionPwdBase pool account credentials (accounts webs01… derive from these).
webstreamSettings.basePortNumberBase for the per-session streamer port formula (base + userNumber × 10).
webstreamSettings.serverHttpPathRoot of the static web client (httpdocs).
webstreamSettings.sessionStartQueueSerial session-start queue tuning — see Session start queue above.
-tags gpu,autocad (command line)Capability tags advertised at registration, used for tag-aware workspace placement.
filesystemRestrictions, profileCleanupSession hygiene applied at pool-account recycle: NTFS DENY ACLs, registry restore, profile purge.

Aligned settings on peer services

Note

For Backend Only installer steps, session-pool sizing, and AWS port ranges, see Installing Backend Nodes and AWS Security Groups and Ports.