Repository navigation
demos/parking: size each worker for one actor and fail load.sh on req… #3391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Bo-Cheng Chu (bochengchu)
wants to merge
1
commit into
agent-substrate:main
Choose a base branch
from
bochengchu:parking-demo-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+42
−6
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,7 +111,18 @@ for i in "${!ACTORS[@]}"; do | |
| kubectl ate proxy actor "${a}" "${port}:80" --atespace "${ATESPACE}" >"${TMP}/${a}.proxy.log" 2>&1 & | ||
| proxy_pids+=($!) | ||
| done | ||
| sleep 3 | ||
| # Wait for each proxy to print its "Proxying ..." ready line before sending load. | ||
| for a in "${ACTORS[@]}"; do | ||
| for _ in $(seq 1 60); do | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we more normal style code like this so the meaning is clear |
||
| grep -q "^Proxying " "${TMP}/${a}.proxy.log" 2>/dev/null && break | ||
| sleep 0.2 | ||
| done | ||
| if ! grep -q "^Proxying " "${TMP}/${a}.proxy.log" 2>/dev/null; then | ||
| echo " proxy for ${a} failed to start:" >&2 | ||
| cat "${TMP}/${a}.proxy.log" >&2 || true | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| # One worker per actor: hammer it with request->suspend until the deadline. | ||
| worker() { | ||
|
|
@@ -138,7 +149,9 @@ wait "${pids[@]}" | |
| # ---- aggregate ------------------------------------------------------------- | ||
| echo | ||
| echo "==> results" | ||
| cat "${TMP}"/*.log 2>/dev/null >"${TMP}/all" || true | ||
| for a in "${ACTORS[@]}"; do | ||
| cat "${TMP}/${a}.log" 2>/dev/null || true | ||
| done >"${TMP}/all" | ||
| total=$(wc -l <"${TMP}/all" | tr -d ' ') | ||
| if [[ "${total}" -eq 0 ]]; then | ||
| echo " no responses recorded -- check proxy logs" | ||
|
|
@@ -157,6 +170,14 @@ printf " 503 unavailable: %s\n" "${busy}" | |
| 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 | ||
| echo " => ${other} requests failed with a non-200/503 status." | ||
| exit 1 | ||
| fi | ||
| if [[ "${ok}" -eq 0 ]]; then | ||
| echo " => 0 requests succeeded (${busy} shed with 503)." | ||
| exit 1 | ||
| fi | ||
| if [[ "${busy}" -eq 0 ]]; then | ||
| echo " => 0 failures under saturation: parking absorbed the contention." | ||
| echo " Re-run with the router started --parked-request-max=0 to see 503s." | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,9 +40,20 @@ metadata: | |
| labels: | ||
| workload: parking | ||
| spec: | ||
| # Intentionally small: 2 workers, so 3+ concurrently-active actors saturate | ||
| # the pool and exercise the parking path. | ||
| # Intentionally small: 2 workers, each sized for one actor, so 3+ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we get rid of comment changes that don't actually change anything? |
||
| # concurrently-active actors saturate the pool and exercise the parking path. | ||
| replicas: 2 | ||
| workerImage: ko://go.ate.dev/substrate/cmd/ateworker-gvisor | ||
| sandboxClasses: | ||
| - name: gvisor | ||
| template: | ||
| # Each worker advertises its container limits as capacity. Sizing CPU to | ||
| # one actor's limit in parking-template.yaml.tmpl caps each worker at one | ||
| # running actor. | ||
| resources: | ||
| limits: | ||
| cpu: "1" | ||
| memory: 1Gi | ||
| requests: | ||
| cpu: 250m | ||
| memory: 1Gi | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.