Emulator Farm

The emulator farm runs many emulator pods against one ACS. Each pod starts by itself and emulates a share of the fleet. A harness measures how many devices one pod can carry.

Overview

Part Purpose

Helm chart deploy/helm/tr069-emulator-farm

Renders one StatefulSet per device class. The chart sets all farm parameters through environment variables.

/farm/stats, /farm/serials and /farm/decisions

Read-only endpoints for the harness and for tests. They are outside the /api control contract.

FarmCleanup

Deletes only the farm’s own devices from the ACS.

Harness loadtest/

Measures the devices-per-pod limit and runs the smoke tests.

Chart and fleet profile

The chart needs image.tag and fleet.runId. The run identifier must match ^[a-z0-9]{6}$. The chart refuses to render if either value is missing or invalid.

The chart splits fleet.devices into four classes.

Class Default share Behavior

normal

remainder

Periodic Inform and Connection Request are on. RPCs answer at once.

sleeping

10 %

Periodic Inform and Connection Request are off. The device parks after its first session.

faulty

5 %

Random retry count is on. Every RPC result is failed.

slow

5 %

Every RPC answers after fleet.slowDelaySeconds (default 20, range 1 to 120).

The shares are placeholders until QA supplies field ratios. The profiles/pure.yaml profile sets all shares to 0. The sizing steps use it.

The chart splits a class into pods of at most fleet.devicesPerPod devices. A class with 0 devices is not rendered. The chart refuses to render in these cases:

  • The shares sum to more than 100.

  • fleet.sessionConcurrency is lower than the devices in one pod.

  • fleet.ramp.spreadSeconds or fleet.periodicIntervalSeconds is lower than 1.

  • A serial prefix is longer than 24 characters.

Each pod uses the serial prefix pf<runId>-<class code><pod index>- and the product class pf<runId>. The class codes are n, z, f and s.

Environment overrides

The emulator reads each parameter from the file start_params.properties. The variable EMULATOR_<NAME> overrides the parameter. <NAME> is the constant name of the parameter in upper case with underscores, for example EMULATOR_SESSION_CONCURRENCY.

The override also works if the file is absent. The emulator writes Parameter overridden param=<name> source=env to the log for each override.

The emulator refuses to start if an EMULATOR_* variable matches no parameter. The emulator also refuses to start if a value cannot be parsed. A Boolean value must be true, false, 1 or 0.

Single-device storage file

The emulator stores the configuration of single devices in a JSON file. The variable SINGLE_DEVICE_STORAGE_FILE sets the path. The property is emulator.single-device-storage-file. The default is single_devices.json, relative to the working directory of the emulator.

Farm parameters

Parameter (variable) Default Range Effect

autoStart (EMULATOR_AUTO_START; chart value fleet.autoStart)

false; chart value true

Boolean

If true, the pod starts the load test when the web server is ready. This is the same start path as POST /api/start. A later POST /api/start does nothing while the test runs. See Chart value fleet.autoStart.

sessionConcurrency (EMULATOR_SESSION_CONCURRENCY)

256

1 to 20000

Number of sessions that run at the same time. The emulator reads it once, at start. A value outside the range refuses the start.

initialEvent (EMULATOR_INITIAL_EVENT)

BOOTSTRAP

BOOTSTRAP, BOOT, PERIODIC

Event of the first Inform of each device.

productClass (EMULATOR_PRODUCT_CLASS)

empty

text

Product class of the emulated devices. The farm uses one class per run.

periodicInformInterval (EMULATOR_PERIODIC_INFORM_INTERVAL)

empty

seconds

Interval of the periodic Inform. An empty value keeps the interval of the parameter tree.

periodicAlignEpochMs (EMULATOR_PERIODIC_ALIGN_EPOCH_MS; chart value fleet.alignEpochMs)

empty (off)

non-negative epoch milliseconds, or empty

Start T0 of the periodic grid T0 + k x interval. If set and periodic Inform is on, every device sends its periodic Inform at a grid point, so all pods emit at the same wall-clock instant. The next session is the first grid point at or after the current time. With initialEvent PERIODIC, the first session also waits for a grid point. Any other value refuses the start and names the variable. The chart accepts an empty value or 13 digits.

serialsFile (EMULATOR_SERIALS_FILE)

empty (off)

file path, or empty

File of the step’s serial numbers, one per line. Blank lines are skipped. If set, the farm runs these devices instead of generated serial numbers. A device keeps its listed serial and starts with initialEvent. Index i of a device is its line among the serials, from 0. See Serial list and per-device phase anchors.

serialsFrom (EMULATOR_SERIALS_FROM)

0

non-negative integer

Index of the first serial of this pod’s slice of serialsFile.

serialsStride (EMULATOR_SERIALS_STRIDE)

1

integer, 1 or more

Step between the serials of this pod’s slice. With 1 the slice is contiguous. With P pods of one class, pod o sets serialsFrom to its base index plus o and serialsStride to P, so every pod holds devices from the whole list. A value below 1 refuses the start.

serialsCount (EMULATOR_SERIALS_COUNT)

0

non-negative integer

Number of serials of this pod’s slice (at most; counted in steps of serialsStride). The value 0 takes the slice to the end of the file. An empty slice refuses the start.

phaseT0Ms (EMULATOR_PHASE_T0_MS)

empty (off)

non-negative epoch milliseconds, or empty

Start t0 of the per-device phase anchors. Needs serialsFile; without it the start is refused. If set, periodicAlignEpochMs and spread are not used. See Serial list and per-device phase anchors.

sweepRate (EMULATOR_SWEEP_RATE)

empty (off)

devices per second above 0, decimal, or empty

Sweep mode: device i sends one session at t0 + i / R, then it sends no periodic Inform. Needs phaseT0Ms; without it the start is refused.

serialPrefix (EMULATOR_SERIAL_PREFIX)

FT

^[A-Za-z0-9-]{1,24}$

Prefix of every serial number. An invalid prefix, or a serial number longer than 64 characters, refuses the start.

connectionRequestAuthEnabled (EMULATOR_CONNECTION_REQUEST_AUTH_ENABLED; chart value fleet.connectionRequestAuth)

true

Boolean

If true, every Connection Request must authenticate with the device’s credentials (TR-069 3.2.2.2 HTTP Digest, G.2.1.4 UDP signature). false accepts unauthenticated HTTP and UDP requests, with a WARN when the shared services start. See Chart value fleet.connectionRequestAuth and Connection Request authentication.

Chart value fleet.autoStart

The chart value fleet.autoStart is a boolean. The default is true. The chart renders it as the quoted string "true" or "false" in EMULATOR_AUTO_START for all four classes.

If you set fleet.autoStart to false, the pods wait for POST /api/start. A load driver uses this to observe a step from before the first Inform. The driver then starts all pods in one round.

The chart schema requires the key. A value that is not a boolean fails with at '/fleet/autoStart': got string, want boolean. An older chart refuses the key, because its fleet schema does not allow other keys.

Chart value fleet.connectionRequestAuth

The chart value fleet.connectionRequestAuth is a boolean. The default is true, and the chart then renders nothing: the image default (authentication on) applies, and the rendered output is the same as before the value existed. Only an explicit false renders EMULATOR_CONNECTION_REQUEST_AUTH_ENABLED: "false" for all four classes. A missing or null value renders nothing either.

The farm devices load the image default tree, whose Connection Request username is ftacs with an empty password. An ACS that knows these credentials authenticates. The load-test harness answers the Digest challenge: loadtest/lib/demo.sh reads the device’s current credentials through GET /apiV2/parameterValue in the pod and passes them to curl on stdin only, CwmpSink --cr-probe uses --cr-user and --cr-password (default ftacs and empty). A value that is not a boolean fails with at '/fleet/connectionRequestAuth': got string, want boolean. An older chart refuses the key, because its fleet schema does not allow other keys.

Ramp and periodic anchor

EMULATOR_SPREAD sets the ramp in seconds. The emulator starts about devices / spread devices every 3 seconds. A value of 1 starts all devices in one batch. This batch is a registration storm.

If the ramp is spread, the next periodic Inform of a device keeps the phase of its anchor. The emulator picks the first time anchor + k x interval after the session start and after the current time. The time is never in the past, even if a retried session lasts longer than the interval. Devices that start aligned stay aligned.

If periodicAlignEpochMs is set, the grid T0 + k x interval replaces the anchor phase. The scheduler tick runs on whole seconds of the wall clock, so an emission can start up to 1 second after its due time.

Serial list and per-device phase anchors

With serialsFile, every pod reads the same file and takes its slice: the indices serialsFrom, serialsFrom + serialsStride, serialsFrom + 2 x serialsStride, and so on, serialsCount of them. With serialsStride 1 this is the range [serialsFrom, serialsFrom + serialsCount). The load driver interleaves the pods of a class (stride = pods of the class), so every pod holds devices from the whole window and no single pod carries the offered rate. A is the number of serials in the whole file. P is the periodic Inform interval of the device. The ManagementServer.URL of each device comes from host, port and url.

If phaseT0Ms is set, device i has the anchor anchor_i = t0 + i x P / A. Its periodic session k is due at anchor_i + k x P. This is an open loop: the due time does not depend on the end of the previous session, on the registration time or on the pod. Two devices of one pod keep different phases.

  • A session that is still running at its next due time skips that due time. The skipped due time is counted in missedDues of GET /farm/stats. The next session is due at the next anchor_i + k x P.

  • A Connection Request session, a 1 BOOT session, a retry after a failed session and a wake from sleep do not move the anchor. After such a session the next due time is again anchor_i + k x P.

  • A pod that restarts computes the same anchors from its environment and the file.

With sweepRate R, device i sends one session at t0 + i / R. After that session the device sends no periodic Inform. A failed session is retried as usual.

Without phaseT0Ms, all devices of the list are due at once.

Connection Request during a session

A Connection Request that arrives while the device is in a session does not start a second session. The emulator queues it. At most one follow-up session is pending, so more requests in the same session add nothing. The follow-up session sends the event 6 CONNECTION REQUEST.

A queued event wakes a device that is parked. When a session slot is released, the emulator starts the session of the parked device that has a queued event.

A device with periodic Inform off does not park while a 1 BOOT or 0 BOOTSTRAP event is due or scheduled. It sends that Inform first.

Farm endpoints

The endpoints are served on port 8555. They are not part of the /api contract and not in Swagger UI.

GET /farm/stats

The response is JSON. The harness parses the field names.

Field Type Meaning

total

number

Serial numbers of the current load test. A stop clears this count. GET /farm/serials keeps every serial since the JVM started. It can list more serials.

active

number

Devices in a session now.

activePeak

number

Highest value of active since the last start.

registered

number

Devices with at least one completed session.

sessionsStarted

number

Sessions started. A skipped session (a lone 7 or 11 event with no pending entry, so no Inform goes out) counts here but in neither sessionsCompleted nor sessionsFailed.

sessionsCompleted

number

Sessions that ended normally.

sessionsFailed

number

Sessions that failed.

emittedFirst

number

Devices that sent their first Inform.

firstEmitStartMs

number

Time of the first Inform, in epoch milliseconds. 0 means unset.

firstEmitLastMs

number

Time of the latest first Inform, in epoch milliseconds. 0 means unset.

heapAfterGcBytes

number

Heap in use after the last garbage collection.

threads

number

Live threads.

mapCount

number

Lines of /proc/self/maps. The value is -1 if the file is not readable.

informsWritten

number

Inform requests written to the wire. All emission windows count on this value.

informsInFlight

number

Informs written and not yet answered. The Inform ends on InformResponse, fault, close, timeout or cancel.

nowMs

number

Wall clock of the JVM, in epoch milliseconds. The harness compares it with its own clock before it starts an aligned step.

storm

object or null

Window record of the first emission of this JVM. null until the first emission. The record has k -1.

waves

array

Window records of the periodic waves. Empty unless periodicAlignEpochMs is set. The emulator keeps the last 8 records.

config

object

serialPrefix, productClass, initialEvent, sessionConcurrency, periodicInformInterval, periodicAlignEpochMs. periodicInformInterval is null if unset. periodicAlignEpochMs is an empty string if the grid is off.

latency

object

Latency histograms, Inform attempts and the end of the last session. See Latency record (latency).

cgroup

object

Cumulative cgroup v2 CPU counters, read at request time. See Cgroup record (cgroup).

missedDues

integer

Periodic due times of the per-device phase anchors that passed while the device was still in a session. The device skips them and keeps its anchor. The value is 0 if the anchors are off. See Serial list and per-device phase anchors.

Source classes: FarmStatsResponse, FarmController, FarmCounters and LatencyHistogram. A consumer must treat a missing field as an error, not as 0.

Latency record (latency)

The session histogram gets one sample for each completed session. The emulator records the sample before it removes the session from active. So when active is 0, every completed session’s sample is in the session histogram.

Field Type Meaning

scheme

text

Bucket scheme. The value is log1.005-v1. A consumer must refuse another value.

epoch

text

16 lowercase hexadecimal characters. The emulator draws a new value at JVM start and on every reset(). A change means that all counts started again.

informAttempts

number

Inform attempts since epoch. The emulator counts an attempt when it subscribes, before the connect. A refused or timed-out connect is an attempt without a sample.

lastSessionEndMs

number

Time of the latest session end, in epoch milliseconds. A failed or cancelled session also moves it. The value is 0 until the first session ends. reset() does not clear it.

informRtt

object

Histogram of the Inform round trip. Fields: count and buckets.

session

object

Histogram of the session duration. Fields: count and buckets.

All counts are cumulative since epoch. To get the counts of a window, subtract two reads with the same epoch.

Each histogram has these rules:

  • buckets maps a decimal bucket index to a sample count. The key has no leading zeros.

  • buckets lists only non-zero entries, in ascending index order.

  • count is the sum of the listed buckets. A consumer must use the sum of buckets and not count.

Bucket scheme log1.005-v1

A sample is a duration in microseconds. The upper bound of bucket i is:

upperMicros(0) = 100
upperMicros(i) = max(floor(100.0 * 1.005^i), upperMicros(i-1) + 1)    for i = 1 to 3299

Bucket i holds a sample v with upperMicros(i-1) ⇐ v < upperMicros(i). The value upperMicros(-1) is 0. Bucket 0 holds 0 to 99 microseconds.

A sample of upperMicros(3299) or more goes to the overflow index 3300. This is about 1400 seconds. The rule upperMicros(i-1) + 1 keeps the low bounds strictly increasing. The power is computed with StrictMath, so every JVM gives the same bounds.

Reference values:

Index i upperMicros(i)

0

100

1

101

2

102

3

103

120

220

121

221

1000

14657

3299

1399064492

The width of a bucket is at most 0.5 % above about 0.35 ms. If you read a percentile as the upper bound of its bucket, the value is at most 0.5 % too high.

Timing points
Histogram Measures Excludes

informRtt

The time from the last write of the Inform to the InformResponse. After a 401 challenge, the emulator writes the request again and times from that last write.

The wait for a session permit and the acquire of a pooled connection. A failed, timed-out or cancelled Inform adds no sample. Each retry is its own exchange with its own sample.

session

The time from the start of the session, after the permit, to the normal end.

The wait for a session permit. A failed or cancelled session adds no sample. sessionsFailed counts failures.

The session histogram includes the reply delay of devices of the slow class. A consumer that compares session times must not merge session from pods of that class.

Cgroup record (cgroup)

The emulator reads the cgroup v2 files of the container when you call GET /farm/stats. The values are cumulative counters. A consumer subtracts two reads.

Field Type Meaning

nrPeriods

number

Count of CFS periods.

nrThrottled

number

Count of periods in which the CPU was throttled.

usageUsec

number

CPU time used, in microseconds.

pressureSomeUsec

number

CPU pressure stall time (some), in microseconds.

readMs

number

Time of the read, in epoch milliseconds.

The value -1 means that the counter is absent. This happens on macOS and on a host without cgroup v2. A consumer must not treat -1 as 0.

Example

The body below is a real response of an emulator on macOS. It ran 5 devices against a sink with a hold time of 50 ms. Only the new fields are shown.

"latency": {
  "scheme": "log1.005-v1",
  "epoch": "ee14540b55fa3d19",
  "informAttempts": 5,
  "lastSessionEndMs": 1792316636425,
  "informRtt": { "count": 5, "buckets": { "1384": 2, "1385": 3 } },
  "session":   { "count": 5, "buckets": { "1478": 1, "1479": 1, "1480": 1, "1482": 1, "1815": 1 } }
},
"cgroup": { "nrPeriods": -1, "nrThrottled": -1, "usageUsec": -1, "pressureSomeUsec": -1, "readMs": 1792316637127 }

Window record (storm and waves)

Field Type Meaning

k

number

Wave index, floor((write time - T0) / interval). The scheduler tags each emission with its index. The storm record has -1.

dueMs

number

Due time T0 + k x interval, in epoch milliseconds. For the storm, the time of the first emission.

firstWriteMs, lastWriteMs

number

Time of the first and the last Inform write of the window. 0 means unset.

informsWritten

number

Informs written in this window.

inFlightPeak

number

Highest number of Informs awaiting InformResponse in this window.

inFlightPeakAtMs

number

Time when inFlightPeak was first reached.

throttledShare

number

Share of CPU periods that the container runtime throttled in the window, from 0 to 1.

cpuUsageUsec

number

CPU time of the container in the window, in microseconds.

pressureSomeUsec

number

Time in the window in which some task waited for CPU, in microseconds (cpu.pressure).

windowMs

number

Span of the cgroup reads: closing read minus opening read. The value is -1 while the window is open.

closed

boolean

true after the closing read.

The emulator reads its own cpu.stat and cpu.pressure when the window opens, before the first write. It reads them again when the writes reach the device count of the JVM. If they never reach it, the emulator reads them at the first tick after dueMs plus 5 seconds. The window is then closed with fewer writes.

A cgroup value of -1 means that the file is absent. A value of -2 means that the window is too short: it is shorter than 200 ms, or no CPU period passed. A value of -2 is never 0. The harness judges a short window with the rule in [short-window-rule].

When the load test stops, the counters return to 0 and storm and waves are cleared. active is a live value. Sessions that end after the stop still reduce it.

GET /farm/decisions

This read-only endpoint shows what the emulator decided for each Inform request of one serial number. A test uses it to wait for the decision instead of a fixed absence window. It is for tests and diagnostics. It is not part of the /api contract.

Send the serial number in the query parameter serial, for example GET /farm/decisions?serial=<serial>. The response is JSON. The members and their order are fixed.

Member Type Meaning

serial

text

The serial number from the request.

scheduled

boolean

true if the scheduler holds the serial number now. The emulator reads it at request time. It is false for a stopped or a never registered device, which can open no session.

spawned

number

Connection Requests that started the one follow-up waiter.

coalesced

number

Connection Requests folded into, or rejected because of, an already pending or establishing one. They add no session. A request rejected with 503 (a session runs and a follow-up is already queued) counts here too.

started

number

Invokes that handed the device to the scheduler for a session.

ignored

number

Invokes that opened no session. The serial number is not scheduled, or a 0 BOOTSTRAP event is pending.

queued

number

Invokes for a device that stayed busy. The emulator defers the event to the next Inform. If the device has no session variables, the emulator drops the event. The counter increases in both cases.

The counters are cumulative for the serial number. A serial number with no decision returns scheduled as given and all counters as 0. The request does not create an entry.

Status Meaning

200

The JSON body above.

400

The parameter serial is missing or blank. The body is empty.

A stop of all devices (stop-all) clears all counters. Source classes: InvokeDecisionsResponse, FarmController, InvokeDecisions and AcsSessionChecker.

GET /farm/serials

The response is text/plain. It lists the serial numbers of this JVM, sorted, one per line.

The list keeps every serial that a load test started since the JVM started. A stop does not clear it. Only a restart of the emulator JVM clears it.

The emulator never removes a serial from this list. A farm pod runs one execution, so the list stays small. A long-lived emulator outside the farm can cycle serial prefixes. In that case the list grows with every new serial.

GET /farm/serial-prefix

The response is text/plain. It returns the current value of the serialPrefix parameter.

PUT /farm/serial-prefix

Send the new prefix as text/plain in the request body. The change applies in memory only. The emulator does not write the properties file.

Status Meaning

204

The prefix changed.

400

The prefix does not match ^[A-Za-z0-9-]{1,24}$. The check runs first, so an invalid prefix answers 400 during a load test.

409

A load test runs. It started with POST /api/start. The prefix does not change.

FarmCleanup

FarmCleanup deletes the farm’s own devices from the ACS. It is a plain Java program and does not start the emulator.

It deletes a device only if both checks pass:

  • The serial number starts with the run prefix pf<runId>-.

  • The exact read-back of the ACS device matches the serial number.

Usage:

farm-cleanup --serials-file <file> --require-prefix pf<runId>- --ws-base http://<acs-host>:<port>/ACSServer-ACS
             [--batch 200] [--expect-registered <n>] [--dry-run] [--verify-only] [--license-limit]

Set the credentials only in the environment:

ACS_WS_USER=<user>
ACS_WS_PASSWORD=<password>

The program has no argument for credentials. The --dry-run output shows both values as <redacted>.

Exit code Meaning

0

Done.

1

A serial number or a call failed.

2

Refused. The program sent nothing. Causes are a bad argument, a serial number without the prefix, or missing credentials.

3

Control violated. The number of devices found is below --expect-registered or above the number of listed serial numbers.

The output is present=<n> deleted=<n> absent=<n> failed=<n>. Source class: FarmCleanup.

Setup and removal modes

Three more modes manage the ACS objects of one run. You use them mostly through the harness. Each mode needs the same credentials as above. Each mode accepts --dry-run and sends nothing then.

Argument set Result

--create-farm-profile --product-class pf<runId> --group-id <id> --periodic-s <seconds>

Creates the profile ftqa-farm-pf<runId>. The output is farm-profile created name=ftqa-farm-pf<runId> group=<g> periodic=<P>.

--delete-farm-profiles --product-class pf<runId> --profile-ids <id>[,<id>…​]

Deletes the listed profiles. The output is farm-profile deleted name=ftqa-farm-pf<runId> ids=<ids>.

--delete-class --product-class pf<runId> --manufacturer <name>

Deletes the product class of the run. The output is farm-class deleted manufacturer=<name> model=pf<runId>.

Use one mode at a time. Do not combine a mode with --license-limit, --verify-only or a device deletion. The program then exits with code 2 and mode-conflict.

Before --delete-class deletes anything, it reads the ACS setting dataStoreExclusionModels.

  • If the setting has a value, the program deletes nothing. It prints farm-class kept reason=exclusion-models-set model=pf<runId> and exits with code 0.

  • If the program cannot read the setting, it exits with code 1 and sends no delete request.

The harness also keeps a class when another profile sits in the group of the class. See When a run refuses or keeps something.

The product class must match pf and six characters from a-z and 0-9. The program refuses every other class.

Harness

All scripts are in loadtest/. Each script that creates containers marks them with the label ft.qa/run=<run> and removes only those.

Command Purpose

bash loadtest/chart-test.sh

Offline chart tests with helm template and helm lint. No cluster needed.

bash loadtest/k3s-smoke.sh

Installs the chart on a throwaway k3s container against a local CWMP sink. It includes a negative control with a wrong Connection Request host. Install F checks the periodic grid. See Install F in the local smoke test.

bash loadtest/farm-capacity.sh local

Sizing run with one container (2 CPU, 2 GiB). It runs registration storms and one aligned periodic step.

bash loadtest/farm-capacity.sh local --parse-self-check

Offline check of the parsers, the formulas and the environment render.

bash loadtest/farm-capacity.sh demo --dry-run

Prints the demo runbook. It changes nothing. Credentials are redacted.

bash loadtest/farm-capacity.sh demo

Runs the demo sizing. It refuses unless DEMO_GO=yes is set, the rig library is readable and the k3s node is listed.

bash loadtest/farm-capacity.sh --recover <demoId>

Repeats the teardown of a demo run that was killed. See Recover a demo run. It refuses unless the demo lock holds the marker of that run.

bash loadtest/farm-capacity.sh --self-test

Offline test with command shims. No Docker needed.

A live local run needs DB_SLOT, IMAGE and a JDK 25. See farm-capacity.sh --help.

jq requirement

The harness reads Kubernetes and pod data with jq. You need jq version 1.6 or later on the demo host.

If jq is missing, the demo run and the recover command refuse with exit code 2. They touch nothing. The local run stops with exit code 1 and the log line FATAL reason=<text>. The text is the same in all three cases:

jq-missing: install jq >= 1.6 or put a static jq first on PATH (e.g. /root/s63-farm/bin)

Install jq, or put a static jq first on PATH, and start the command again. The remedy is the same in demo mode, in local mode and for the recover command. The dry-run runbook lists command -v jq as a check.

Local run output

The local storm ladder starts at the first storm size and halves the size to 100. It stops at the first storm without a hard knee. That size is devices_per_pod_storm.

The last line of a local run starts with farm-capacity local:. It carries these tokens:

Token Meaning

devices_per_pod_storm=<n>

The largest storm N without a hard knee, or unmeasurable.

devices_per_pod_at_25pct=<n>

The aligned devices per pod, or unmeasurable.

gate=<throttle|short-window|unmeasured>

How the harness judged emulator-bound on the rung that set devices_per_pod_at_25pct.

If the gate is short-window, the prose reads devices_per_pod_at_25pct>=<n> (ladder top; gate=short-window: every judged wave emitted completely inside 200 ms, throttle not measured; re-judged on the demo).

The report has the line devices_per_pod_at_25pct gate: <text>. The step table has a gate column.

Exit code Meaning

3

devices_per_pod_at_25pct is unmeasurable.

4

devices_per_pod_storm is unmeasurable, and the aligned value is measured.

In both cases the report outcome line reads incomplete …​ exit=<n> and never complete.

Report legend

  • Hazelcast mem max MiB is the highest Hazelcast memory use in the step.

  • CPU cores of a storm step comes from the emulator’s own storm record. The polls can miss the storm.

  • CPU cores of an aligned step is the poll delta: the pod CPU use over the step divided by the wall time.

  • step-average throttled % (all pods) is the sum of nr_throttled divided by the sum of nr_periods of all pods over the step. It is not a per-pod maximum.

Sizing

These are LOCAL numbers. They come from OrbStack with one pod limited to 2 CPU and 2 GiB. The demo measurement is pending. Use 500 devices per pod for aligned steps and 200 devices per pod for storm steps on the demo.

Two local runs measured the devices-per-pod limit for aligned steps. The images come from different commits.

Run Image commit devices_per_pod_at_25pct Aligned steps

u69306

24718d9

500

N 1000 has the knee emulator-bound. N 500 has no hard knee.

s6c2ba

6ba57ba

1000

N 1000 has no hard knee.

Both runs used --cpus 2, --memory 2g, the pure profile and a Periodic Inform interval of 60 seconds.

The measured range for devices_per_pod_at_25pct is 500 (u69306) to at least 1000 (s6c2ba and o018e0). In s6c2ba and o018e0 the gate is short-window. The value 1000 is the top of the ladder. The throttle was not measured. The demo judges the value again.

Every local cold storm of 100 to 1000 devices at 2 vCPU per pod was emulator-bound. The throttled share was 0.40 to 0.89. Locally, devices_per_pod_storm is therefore unmeasurable.

Devices per pod for storms

The demo uses a separate value for storm steps. Set DEVICES_PER_POD_STORM to 200. It is required and numeric. If it is missing or not numeric, the demo refuses to start. The refusal names this rule.

D_pp depends on the step kind:

Step kind D_pp

B, BOOT

DEVICES_PER_POD_STORM (200)

P, M

DEVICES_PER_POD (500)

Registration storm, N 1000

Run Registered t100 (s) Emission (s) Registrations per s activePeak Step-average throttled % Knees

u69306

1000

4.2

1.1

235.8

921

55.5

cpu-throttle, emulator-bound

s6c2ba

1000

3.4

0.8

292.2

907

25.0

emulator-bound

Aligned periodic steps

Wave 0 is shown in the report but does not count. Only waves 1 and later count. E is the time from the due instant to the last Inform written.

Run N Wave k E (ms) Informs written Max throttled share Result

u69306

1000

1

851

1000

0.625

emulator-bound

u69306

1000

2

176

1000

-2 (window too short)

emulator-bound

u69306

500

1

174

500

-2 (window too short)

no hard knee

u69306

500

2

156

500

-2 (window too short)

no hard knee

s6c2ba

1000

1

180

1000

-2 (window too short)

no hard knee

s6c2ba

1000

2

170

1000

-2 (window too short)

no hard knee

In all aligned steps the peak of Informs awaiting InformResponse equals N. The skew is 0 ms because each run had one pod.

Variance between the runs

The two runs give 500 and 1000 devices per pod. The cause is the length of the warm wave.

  • In s6c2ba, the warm waves at N 1000 emitted in 170 to 180 ms. This window is too short to evaluate the throttle. The throttled share is -2, so the step has no knee.

  • In u69306, wave 1 at N 1000 took 851 ms. The container was throttled in 62.5 % of the CPU periods. The step has the knee emulator-bound.

The demo uses the conservative value DEVICES_PER_POD=500 for aligned steps. The demo harness also checks emulator-bound for each wave itself.

Knee legend

A knee marks a limit. A hard knee fails the step. A soft knee is recorded only. The effect of a hard knee in a storm step is described in Storm stop rule.

Knee Kind Meaning

jvm-oome, cgroup-oom

hard

The emulator ran out of heap memory, or the container ran out of memory.

reg-short

hard

The step ended before all devices registered.

session-fail

hard

sessionsFailed is greater than 0.

storm-not-reached

hard

In a storm, the emission took longer than 5 seconds, or fewer than N Informs were written, or fewer than N devices registered.

aligned-not-reached

hard

In some wave k >= 1, E is longer than 5 seconds, or fewer than N Informs were written.

aligned-periodic-missing

hard

Waves 1 and 2 are not both present with N Informs written.

acs-not-drained

hard

In a P step, the ACS did not finish its bootstrap tasks within DRAIN_STALL_S or DRAIN_CAP_S. The step has no aligned phase and the sequence stops. See Farm profile and drain.

emulator-bound

hard

throttledShare is above 0.25 in the storm or in any wave k >= 1. The emulator, not the ACS, set the pace. The ACS figures of the step are invalid: the ACS was under-driven.

emulator-starved

hard

pressureSomeUsec is above 25 % of windowMs in any record. Some task waited for CPU.

rate-drop, emit-serial, cpu-throttle

soft

The registration rate dropped, the first wave took more than 50 % of t100, or more than 25 % of the CPU periods were throttled over the step.

peak-skew

soft

The pods reached their wave peaks at times that differ by more than E. The sum of the pod peaks is then not simultaneous.

A cgroup ratio of -1 (file absent) is not judged. A window shorter than 200 ms has the ratio -2. The harness judges that window with this rule:

  • The window is emulator-bound if the CPU use is at least 0.9 x the pod CPU limit and inFlightPeak is below informsWritten.

  • Otherwise the window is not bound, and the report notes the reason.

  • A record that neither rule can judge is unmeasured.

Each step has a gate. The gate shows how the harness judged emulator-bound.

Gate Meaning

throttle

At least one judged record had a throttled share.

short-window

Only the short-window rule judged the records.

unmeasured

No record was judged. An unmeasured rung gates only the aligned ladder.

Concurrency figures

Each Inform awaiting its InformResponse counts as in flight. The report prints two figures for every wave.

  • Upper bound: the sum over all pods of the wave inFlightPeak. The value is simultaneous only within the skew, that is, the spread of the pods' inFlightPeakAtMs.

  • Lower bound: the largest inFlightPeak of one pod.

The label "Informs awaiting InformResponse" means the inFlightPeak value. It counts Informs that the emulator wrote and the ACS did not yet answer. activePeak is a different value. It counts emulator sessions, including sessions queued inside the emulator. Do not use activePeak as the concurrency figure.

Demo budget rule

The demo shares the host with other work. The budget is fixed.

  • The sum of the pod CPU limits is at most 10 vCPU.

  • The sum of the pod memory limits is at most 16 GiB.

  • The number of pods for a step is ceil(N / D_pp). D_pp is DEVICES_PER_POD_STORM for B and BOOT steps and DEVICES_PER_POD for P and M steps.

  • If the pods exceed the budget, the step runs once at the capped N'. N' is floor(budget / cpu_limit) x D_pp. The sequence stops after that step.

  • The harness aborts the step before T0 if the rendered limits exceed a budget. It aborts a step if the measured CPU use of all farm pods exceeds the budget for two consecutive windows.

The honest figure is the largest MEASURED aligned step without a hard knee. The report never states N for a step that did not run.

The CPU that the full N needs is ceil(N / D_pp) x cpu_limit. This is a linear extrapolation from the declared D_pp. The report line reads (linear extrapolation from declared D_pp=<n>; local measurements 500-1000, see farm.adoc Sizing).

For N 10000 at D_pp 500 and a limit of 2 vCPU, the full N needs 20 pods and 40 vCPU. This is more than the 10 vCPU budget. The demo measures at most 2500 aligned devices. The demo reports the largest honest figure instead.

Demo steps

The default value of DEMO_STEPS is B1000 BOOT1000 P1000 P2500 P5000 P10000 M10000. The ladder B100 B250 B500 B1000 BOOT1000 …​ is opt-in. Set it in DEMO_STEPS.

Farm profile and drain

Why: the ACS applies its DEFAULT profile to every new product class. That profile sets PeriodicInformInterval to 86400 seconds. A new farm fleet therefore left the 300 s grid. In one demo run the aligned waves lost devices for this reason. The harness now configures the ACS for the aligned steps. The emulator keeps its own behavior.

What a P step does, in this order:

  1. It registers one seed device and deletes it. This creates the product class group of the run in the ACS. The seed is setup. It has no figures and no row in the report. Its sampler rows carry the label <step>seed.

  2. It reads the group id of the run.

  3. It checks the ACS read-only. If a profile named ftqa-farm-pf<runId> exists, the step stops. If the group has any profile, active or not, the step stops. See When a run refuses or keeps something.

  4. It writes the run record. The record names the group and states that the profile create is attempted.

  5. It creates the profile ftqa-farm-pf<runId> for the group. The profile sets PeriodicInformEnable to 1 and PeriodicInformInterval to P for Device. and InternetGatewayDevice..

  6. It checks in the database that the profile is active, belongs to the group and carries P. It then completes the run record.

  7. It registers the fleet in phase 1 and waits until the ACS has no pending tasks for the run.

  8. It checks that every device uses the farm profile.

  9. It runs the aligned phase.

The harness never changes or deletes a profile that it did not create. It deletes a profile only if the run record shows that this run created it. It looks the profile up by its derived name and by the group in the record.

The refusal and abort texts of the farm profile are:

farm-profile-refused existing=name profile=ftqa-farm-pf<runId>
farm-profile-refused existing=group-profile group=<g> profiles=<n>
farm-profile-not-applied bound=<a>/<N>
farm-profile-not-applied farm=<b>/<N>
farm-seed-not-registered
farm-profile-failed detail=profile-count-query-failed
farm-profile-failed detail=group-profiles-query-failed
farm-profile-failed detail=create-failed ws-op=create-farm-profile ws-rc=<rc> acs="FAILED reason=... detail=..." log=<runDir>/ws-calls.log
farm-profile-failed detail=create-gave-no-created-line log=<runDir>/ws-calls.log
farm-profile-failed detail=profile-ok-query-failed
farm-profile-failed detail=profile-ok=<n>
farm-profile-failed detail=profile-val=<a>/<b>
farm-profile-failed detail=profile-id-not-unique

Each farm-profile-refused text continues with the reason and the action. When a run refuses or keeps something quotes them.

Run record

The harness claims every new run id before it writes anything to the ACS. The claim creates the file <runDir>/acs-obj.<runId>. The file stays "NOT verified" until the teardown removes the ACS objects of the run and checks in the database that none remain. If the run stopped between the claim and its first install, the teardown only counts the product class group and the profile of the run id, read-only. Both counts 0 make the record "nothing installed, verified 0". A count above 0 keeps it "NOT verified": the objects are not ours and stay untouched. The report table "ACS objects" and the line K1: are built from these files.

Drain of the ACS bootstrap tasks

A new device receives bootstrap tasks from the ACS. Phase 1 waits for them, so they do not fall into the counted waves. The wait ends when the number of pending tasks of the run is 0 on consecutive samples that span BOOT_DRAIN_SETTLE_S seconds. A single zero is not enough, because the ACS can add tasks during a session.

Knob Default Meaning

BOOT_DRAIN_SETTLE_S

30

Seconds that the pending count must stay at 0.

DRAIN_STALL_S

2 x P + ALIGN_DRAIN_S, that is 630 for P 300

Seconds without a new lowest pending count. The count can rise and fall during the drain. Only a new lowest value counts as progress.

DRAIN_CAP_S

3600

Absolute limit of the drain in seconds.

Both clocks start when all N devices are registered. Each knob accepts a whole number from 1 to 999999. Other values are refused.

The wall limit of phase 1 follows these rules:

  • While devices are still registering, the step keeps its own wall limit STEP_WALL_S, counted from the start of the step.

  • The wall limit grows by DRAIN_CAP_S only after all N devices are registered.

  • If the drain cap is reached in the same sample, the knee acs-not-drained wins over the wall limit.

If the stall limit or the cap is reached, the step does not abort. The harness records the knee acs-not-drained on the phase-1 row. It then runs no binding check and no aligned phase. It stops the sequence, so later steps do not run. It tears down as usual and the run ends with outcome: complete.

The phase-1 row includes the drain time in its wall seconds and sessions per second. The drain line and the report carry these values:

Value Meaning

drained_s

The drain hold time. It is the number of seconds from the moment all N devices registered until the pending tasks of the run stayed at 0.

failed_tasks

The number of failed ACS tasks of all devices of the run. It counts every failed task, not only the farm SetParameterValues. The harness reads it after the sampler ends.

If failed_tasks is greater than 0, check the failed tasks of the run in the ACS before you trust the aligned figures.

Steps without the farm profile

Only the P steps use the farm profile. Step 0, B, BOOT and M stay on the DEFAULT profile of the ACS.

  • B and BOOT include the real bootstrap work of the ACS in their registration storm.

  • M is the unaligned mix. Where the 86400 setting takes effect changes only which devices still inform during the hold.

The farm profile omits the Connection Request user name and password of DEFAULT. The P steps use no Connection Requests.

Comparison with earlier runs

The report carries this statement: aligned P figures are not comparable with runs made before the farm profile existed. The farm profile sets P, and the bootstrap tasks are drained before the waves.

Storm stop rule

  • If a storm step has a hard knee and all its classes are emulator-side, the step is labelled. The later storm steps still run. The emulator-side classes are emulator-bound, emulator-starved and cpu-throttle.

  • If a storm step has an ACS-side hard knee, the remaining B and BOOT steps stop.

  • P steps always run.

Storm label and vCPU estimate

Every storm step carries this label:

emulator-bound at 2 vCPU/pod: offered load, ACS registration concurrency NOT proven at this budget

Before the run, the harness prints the offered load:

storm: offered load <pods> x <DPPS> = <N>; emulator-bound expected at 2 vCPU/pod; vCPU estimate printed after the step

After each storm step, the harness prints the vCPU that an un-throttled 1000-device storm needs. The value is always an estimate and never a measurement.

The harness prints one of three lines.

  • The bracket. The harness calculates it from the cgroup CPU use and the throttled time over the storm window.

    un-throttled 1000-device storm needs ESTIMATED <lo>-<hi> vCPU (extrapolated from measured cgroup usage + throttled time over the storm window; estimate, not measured)
  • The fallback. If the storm ends inside one 5 s cgroup sample, the bracket is unavailable. The harness then sums cpuUsageUsec / windowMs of the emulator storm record over all pods. It scales the sum to 1000 devices (1000/N). This value is a lower bound, because the throttled time is not in the record. The real need can be higher.

    un-throttled 1000-device storm needs ESTIMATED >= <lo> vCPU (lower bound from the emulator's storm-window CPU usage; throttled time not in that record; estimate, not measured)
  • No estimate. If both calculations have no usable readings, the harness never prints a number.

    estimate unavailable: <reason>; storm-record fallback unavailable: <reason>

When a run refuses or keeps something

The harness never changes an ACS object that it did not create. If it finds such an object, it refuses a step or keeps a class. Three cases exist.

Every web-service call of the harness is written to <runDir>/ws-calls.log. Each entry has the operation, the return code and the full output, including the refusal lines of the ACS. If a create or a teardown is refused, read this file first.

The run id is already in use

The claim of a new run id fails if the ACS already holds a product class group or a profile of that id. The run stops before it writes anything. The text is:

run-id-collision run=<run> group=<g> profile=<p>: the ACS already holds a product class group or a profile of this run id; they are not ours and stay untouched - rerun the demo (a new run id is drawn)

The objects belong to someone else. The harness leaves them untouched. Start the demo again. The harness draws a new run id.

A profile with the farm name exists

The pre-create check of a P step finds a profile named ftqa-farm-pf<runId> that this run did not create. The step stops before it writes anything. The text is:

farm-profile-refused existing=name profile=ftqa-farm-pf<runId>: a profile of this name that this run did not create exists in the ACS; nothing was written and it stays untouched - find who created it before rerunning

Find the owner of the profile in the ACS. Start the demo again after the owner has removed it.

The group already has a profile

The pre-create check finds any profile that references the product class group of the run, active or not. The step stops before it writes anything. The text is:

farm-profile-refused existing=group-profile group=<g> profiles=<n>: a profile this run did not create (active or not) references the run's product class group; nothing was written, the class is kept - remove or re-point that profile in the ACS before rerunning

Remove the profile in the ACS, or point it at another group. Start the demo again.

A foreign profile keeps the product class

At teardown the harness removes its own profile first. If another profile still references the group of the class, the harness sends no delete request and keeps the class. The teardown ends with exit code 0 and releases the lock. The harness records this line for the run:

pf<run> manufacturer=<name> reason=foreign-profile-in-group (remove that profile in the ACS, then delete the class with the delete-class command of the runbook residue section)

The report names the kept class in the K1: line and in the "ACS objects" table. To remove the class, perform these steps:

  1. Remove the foreign profile in the ACS.

  2. Run the --delete-class command from Objects that the teardown leaves for the run id.

The class is also kept if the ACS setting dataStoreExclusionModels has a value. The reason in the list is then dataStoreExclusionModels-set. The residue command refuses under the same guard.

Known limits

ID Limit

K1

The harness removes the ACS objects of every run at teardown. These are the profile, the product_class row and the product_class_group row. It deletes only objects of its own run id. It deletes a profile only if the run record shows that this run created it. After each removal it checks in the database that the count is 0. The ACS keeps the product class if the ACS setting dataStoreExclusionModels has a value. The harness keeps the class if another profile references its group. See When a run refuses or keeps something.

The report has an "ACS objects" table with one line per run id. It also has the residue line K1:. The line names each run id only under a statement that is true for it. A run id whose record is not verified comes first, after K1: NOT verified 0 for run id(s), with the recover command. A run id that was claimed but never installed and whose objects exist in the ACS is named as not ours. The line then lists the kept classes with the reason, or none. It names the run ids whose devices were removed and whose class is gone, the run ids whose farm profile was deleted, and the run ids that stopped before their first install. A run id with a kept class is never named as removed.

The web service cannot remove two items:

* One Profile-<id> task transaction per P run stays in the ACS. * The ACS deletes the Demo_Manufacturer row when no product class uses it. The ACS creates the row again at the next Inform.

K2

FarmCleanup removes the cpe row and the cpe_serial license slot, and nothing else. The other data of a deleted device stays in the ACS database. The harness removes none of it, and the recover command does not remove it either. Do not expect the ACS to remove it: in the demo run of 2026-10-17, 10.7 million cpe_parameter rows of deleted farm devices were still in the database, and the count kept growing for at least 13 minutes after the teardown.

Before each deleting pass, the harness reads the lowest and the highest cpe id of the run and records them in <runDir>/acs-obj.<runId> as cpe_ids=<min>..<max>. The K2: line of the report counts, per run, the cpe_parameter rows in that id range that no longer have a cpe row. It gives the UTC time of the count and a query to count again. For example (illustrative values):

[source,text] ---- K2: parameter rows of the deleted farm devices still in the ACS database (cpe_parameter rows whose cpe_id is in the run’s cpe id range and has no cpe row; counted 2026-10-17T21:20:00Z): run u14526 ids 8517..10518 rows 10665415. This harness removes none of them and does not wait for the ACS to; the count can grow after this report. Check again: select count(*) from ftacs.cpe_parameter p where p.cpe_id between 8517 and 10518 and not exists (select 1 from ftacs.cpe c where c.id = p.cpe_id); the recover command does not remove them. ----

A run that has no recorded id range, or whose count failed, says not measured and the reason. It never says 0. The count is taken when the final report is written, after the teardown, so it can be lower than the final number. The id range can also hold devices that are not from the farm, for example a QA device that registered during the run and was deleted later; their rows are counted too. The report written before the teardown has no count. Its K2: line says that the count follows the teardown. If you still see that line, the teardown did not finish: run the recover command, which rewrites the report.

K3

If you stop a demo run with kill -9, the teardown does not run. The demo lock stays in place. Run the recover command in Recover a demo run to clean up.

Objects that the teardown leaves

A kept class stays in the ACS. Runs made before the farm profile existed also left one product class group per run in the ACS. Run this command once for each run id, from the dry-run runbook. First check in the ACS that no profile and no device uses the class:

docker run --rm --network host --env-file <creds-file> --label 'ft.qa/run=<old runId>' --entrypoint java tr069-emulator:s63 -cp /app/app.jar -Dloader.main=com.ftacs.tr069.emulator.farm.FarmCleanup org.springframework.boot.loader.launch.PropertiesLauncher --ws-base http://127.0.0.1:8080/ACSServer-ACS --delete-class --product-class 'pf<old runId>' --manufacturer Demo_Manufacturer

The command accepts only a product class of the form pf<runId>. If dataStoreExclusionModels has a value, the command keeps the class. Run the command by hand. The harness never runs it.

Install F in the local smoke test

k3s-smoke.sh installs the chart in six checks, A to F. Install F proves the following on a local machine.

  • The sink answers the first session of each device with one SetParameterValues. The interval is P for devices with an even number and 86400 for devices with an odd number.

  • Each device with an accepted 86400 setting leaves the grid after wave 0. It sends one periodic Inform.

  • Each device that keeps P sends a periodic Inform in waves 0, 1 and 2.

  • The sink checks each serial number. The cell is green only if every device behaves as its setting predicts.

This shows that an interval from the ACS equal to P keeps the alignment, and that 86400 breaks it.

A local run cannot prove two things. It cannot prove which profile the real ACS selects. It cannot prove that the web service accepts the profile request. Only the demo run proves both. The P step stops with a clear reason if either fails.

Recover a demo run

<demoId> is the six characters at the end of the run directory name <timestamp>-demo-<demoId>. It matches ^[a-z0-9]{6}$. It is not the run identifier of a step. A step run identifier is refused, and the refusal names the demo identifier candidates.

If the teardown of a demo run cannot finish, the harness keeps the lock. Its outcome line is teardown-incomplete. It prints the next command. Run it from the repository root:

RIG_LIB=<ftacs>/scripts/rig/rig-lib.sh bash loadtest/farm-capacity.sh --recover <demoId>

The recover command works in this order:

  1. It refuses with original-run-alive if the lock or the saved main process is still alive.

  2. It stops the saved sampler process.

  3. It removes the saved credentials file.

  4. It checks that the demo lock holds the marker of the run.

  5. It repeats the teardown with its own credentials file.

  6. It removes the ACS objects of the run, first the profile and then the product class.

Before step 1, the command checks for jq. See jq requirement.

If the teardown cannot finish, the outcome line ends with teardown-incomplete: lock kept (<lock path>) and the next command. The text can include ws-op=<op> ws-rc=<rc> and the path of ws-calls.log. Read that file for the ACS answer, then run the printed command again.

If you stop the harness with INT, TERM or HUP, the harness removes the credentials file before it exits. If a step aborts, the harness still writes report.md for the completed steps. The sample that triggered the abort is in samples.txt, so the per-step host table shows that value (for example, the ACS heap after GC that crossed the limit). The row of the aborted step has (aborted: <reason>) after the step name. A signal (INT, TERM, HUP) shows as rc-<exit code>. If the step aborts on its first sample (for example, a probe that failed), there is no sample, so the table has no row for that step. The outcome: line names the reason. The report has the line outcome: complete, outcome: aborted step=<s> reason=<r> or outcome: teardown-incomplete.

Changelog

  • The P steps use a farm-owned ACS profile and drain the ACS bootstrap tasks before the aligned phase. Teardown removes the profile, the product class and the group of every run.

  • The harness checks for jq before it touches anything. The refusal text names the remedy in demo, recover and local mode.

  • The harness refuses a P step if the group of the run already has any profile. It keeps the product class if another profile references the group.

  • The harness writes every web-service call to <runDir>/ws-calls.log and records each run id at claim time.

  • Aligned P figures after this change are not comparable with earlier runs.