Skip to content

demos/parking: size each worker for one actor and fail load.sh on req… - #3391

Merged
Dmitry Berkovich (dberkov) merged 1 commit into
agent-substrate:mainfrom
bochengchu:parking-demo-fix
Nov 3, 2026
Merged

Dmitry Berkovich (dberkov) merged 1 commit into
agent-substrate:mainfrom
bochengchu:parking-demo-fix

Conversation

@bochengchu

@bochengchu Bo-Cheng Chu (bochengchu) commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #3287

WorkerPool/parking in demos/parking/parking.yaml.tmpl did not set container resource limits, so the Kubernetes Downward API exposed the node's allocatable capacity in /run/worker-capacity. As a result, 2 workers had room for all 4 1000m actors at once and request parking was never triggered. Set per-worker container limits to 1 CPU and 1Gi memory so each worker hosts at most one actor.

Also add a wakeupProbe on /readyz port 80 to demos/parking/parking-template.yaml.tmpl (matching demos/counter/counter-template.yaml.tmpl) so golden memory snapshots are captured after the counter HTTP server binds port 80.

In demos/parking/load.sh:

  • Write kubectl ate proxy actor output to .proxy files instead of .proxy.log so cat "${TMP}"/*.log does not count proxy startup lines as failed requests.
  • Wait for each local proxy to start listening before generating load, and fail fast with the proxy output if a proxy exits early.
  • Exit 1 when any request fails with a non-200/503 status (other > 0) or when no requests succeed (ok == 0).

@bowei Bowei Du (bowei) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LG

Comment thread demos/parking/load.sh Resolved
Comment thread demos/parking/load.sh Resolved
Comment thread demos/parking/load.sh Resolved
Comment thread demos/parking/parking.yaml.tmpl Resolved
Comment thread demos/parking/load.sh Resolved
Comment thread demos/parking/load.sh
printf " other : %s\n" "${other}"
printf " 200 latency : avg %ss, slowest %ss <- parked requests sit here\n" "${avg_ok}" "${slowest_ok:-n/a}"
echo
if [[ "${other}" -gt 0 ]]; then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 question 🟢 – This makes any single non-200/503 fatal, including a 504 from a resume that outlives the router timeout or a 000 from one dropped proxy connection mid-run. Is one transient error meant to fail the whole demo run, or should the hard failure be reserved for ok == 0?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, any non-200/503 is intended to fail the script: the router returns 503 when a parked request's budget expires or the lot is full, whereas 000/4xx/502/504 indicate a broken proxy, auth/routing misconfiguration, or backend error rather than normal parking/shedding behavior.

WorkerPool/parking omitted container resource limits, so the Kubernetes
Downward API reported the node's allocatable capacity in
/run/worker-capacity. Two workers held all four 1000m actors at once
without triggering request parking. Set per-worker container limits to
1 CPU and 1Gi memory so each worker hosts at most one actor.

Add a wakeupProbe on /readyz port 80 to parking-template.yaml.tmpl so
golden memory snapshots are captured after the counter server binds
port 80.

In load.sh, wait for each proxy to start listening before generating
load, aggregate only actor request logs (excluding .proxy.log files),
and exit non-zero when requests fail with a non-200/503 status or when
zero requests return 200 OK.

Signed-off-by: Bo-Cheng Chu <[email protected]>
@dberkov
Dmitry Berkovich (dberkov) added this pull request to the merge queue Nov 3, 2026
Merged via the queue into agent-substrate:main with commit a9fe809 Nov 3, 2026
5 checks passed
Eitan Yarmush (EItanya) pushed a commit to kagent-dev/substrate that referenced this pull request Nov 3, 2026
agent-substrate#3391)

Fixes agent-substrate#3287

`WorkerPool/parking` in `demos/parking/parking.yaml.tmpl` did not set
container resource limits, so the Kubernetes Downward API exposed the
node's allocatable capacity in `/run/worker-capacity`. As a result, 2
workers had room for all 4 `1000m` actors at once and request parking
was never triggered. Set per-worker container limits to `1` CPU and
`1Gi` memory so each worker hosts at most one actor.

Also add a `wakeupProbe` on `/readyz` port `80` to
`demos/parking/parking-template.yaml.tmpl` (matching
`demos/counter/counter-template.yaml.tmpl`) so golden memory snapshots
are captured after the counter HTTP server binds port 80.

In `demos/parking/load.sh`:
- Write `kubectl ate proxy actor` output to `.proxy` files instead of
`.proxy.log` so `cat "${TMP}"/*.log` does not count proxy startup lines
as failed requests.
- Wait for each local proxy to start listening before generating load,
and fail fast with the proxy output if a proxy exits early.
- Exit `1` when any request fails with a non-200/503 status (`other >
0`) or when no requests succeed (`ok == 0`).

Signed-off-by: Bo-Cheng Chu <[email protected]>
(cherry picked from commit a9fe809)
Signed-off-by: Eitan Yarmush <[email protected]>
Dmitry Berkovich (dberkov) pushed a commit that referenced this pull request Nov 3, 2026
#3391)

Fixes #3287

`WorkerPool/parking` in `demos/parking/parking.yaml.tmpl` did not set
container resource limits, so the Kubernetes Downward API exposed the
node's allocatable capacity in `/run/worker-capacity`. As a result, 2
workers had room for all 4 `1000m` actors at once and request parking
was never triggered. Set per-worker container limits to `1` CPU and
`1Gi` memory so each worker hosts at most one actor.

Also add a `wakeupProbe` on `/readyz` port `80` to
`demos/parking/parking-template.yaml.tmpl` (matching
`demos/counter/counter-template.yaml.tmpl`) so golden memory snapshots
are captured after the counter HTTP server binds port 80.

In `demos/parking/load.sh`:
- Write `kubectl ate proxy actor` output to `.proxy` files instead of
`.proxy.log` so `cat "${TMP}"/*.log` does not count proxy startup lines
as failed requests.
- Wait for each local proxy to start listening before generating load,
and fail fast with the proxy output if a proxy exits early.
- Exit `1` when any request fails with a non-200/503 status (`other >
0`) or when no requests succeed (`ok == 0`).

Signed-off-by: Bo-Cheng Chu <[email protected]>
(cherry picked from commit a9fe809)
Signed-off-by: Eitan Yarmush <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants