Repository navigation
Conversation
…8 replicas From a LinkedIn comment: run the same flash sale with a low and a high cap and compare checkout success rate and cost per 1,000 completed orders. Container Apps caps replicas, not nodes. - scripts/flash_sale.py: signs buyers up (not timed), then each buys 1 item over and over. A failed checkout retries the same cart, so every order is 1 item in both runs. top_up gives every run the same starting stock. Works locally and against Azure. - infra/autoscale_demo.py (make flash-sale CAP=3|8, Azure only): prints the most the run can cost and asks first; sets every service's max replicas; turns inventory's switches on only to top up (off again in finally); waits for every new revision; runs the sale; reads Azure Monitor replicas and requests per revision through the 5-min cooldown; prices sale time active, cooldown idle, plus MySQL, at list price; puts the cap back to 3 in finally; saves flashSaleResults.json. - Demo page /patterns/autoscaling shows the recorded runs side by side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lf the cost per 1,000 - Cap 3: 50.3% of checkouts succeeded (1,289 orders), $0.032, $0.025 per 1,000 orders. - Cap 8: 99.2% (5,193 orders), $0.067, $0.013 per 1,000 orders. - Fixes found in the run: sign-up retries a busy user service (it is not timed), and a buyer whose earlier checkout went through after a timeout (404, no open order) starts a new cart. - README section, screenshot, 404 label on the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
From a LinkedIn comment: run the same flash sale with a 3 and an 8 cap, compare checkout success rate and cost per 1,000 completed orders. Container Apps caps replicas, not nodes.
What
scripts/flash_sale.py: buyers sign up first (not timed), then each buys 1 item over and over. A failed checkout retries the same cart, so orders stay 1 item in both runs.top_upgives each run the same stock.make flash-sale CAP=3/CAP=8(infra/autoscale_demo.py, Azure only): prints the maximum cost and asks first, sets max replicas, switches inventory's demo switches on only to restock (off infinally), waits for new revisions, runs the sale, reads Azure MonitorReplicas/Requestsper revision through the 5-min cooldown, prices at list price (sale active, cooldown idle, plus MySQL), resets the cap to 3 infinally./patterns/autoscalingshows the saved runs. No run is recorded yet: the Azure run needs the owner's go-ahead, then the results, a screenshot and the README section follow in this PR.Tests
🤖 Generated with Claude Code