tune-load-balancer-health-checks
Use when a load balancer marks healthy nodes down, or keeps sending traffic to a broken one. Set the check path, interval, timeout, and unhealthy threshold from real p99 latency so checks reflect serving ability, not just process liveness.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- tune-load-balancer-health-checks
- description
- Use when a load balancer marks healthy nodes down, or keeps sending traffic to a broken one. Set the check path, interval, timeout, and unhealthy threshold from real p99 latency so checks reflect serving ability, not just process liveness.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md358 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Tune load balancer health checks
A health check is a contract with the balancer about what "able to serve" means. Too shallow and it routes traffic to a broken node; too strict and it churns nodes out of the pool under load.
Procedure
- Pick a dedicated endpoint that touches real dependencies but is cheap:
The check must fail when the database or cache the app needs is unreachable, and pass otherwise.curl -sf -o /dev/null -w '%{http_code} %{time_total}\n' http://10.0.1.5:8080/healthz - Measure the endpoint's own latency, then set the timeout above its p99:
Setfor i in $(seq 1 50); do curl -s -o /dev/null -w '%{time_total}\n' http://localhost:8080/healthz; done \ | sort -n | tail -1 # slowest of 50 ≈ p98timeout = 2 × slowest. A timeout below p99 causes flapping exactly when traffic is high. - Choose interval and unhealthy threshold from the drain budget:
interval=10s,unhealthy_threshold=3→ 30 s to detect a dead node. Largerintervaldetects slower but generates less check traffic and jitter.
- Set a separate healthy threshold (usually 2) so one flaky success does not re-add a bad node.
- Return
503from the endpoint when a dependency is down, not a200with a JSON body — the LB reads the status code, not your payload. - Exclude the health endpoint from auth and rate limits so the checker never gets a 401/429.
- After changing thresholds, re-check the balancer's reported state:
aws elbv2 describe-target-health --target-group-arn "$TG" \ --query 'TargetHealthDescriptions[].[Target.Id,TargetHealth.State,TargetHealth.Reason]'
Pitfalls
- A health check that only dials the TCP port ("connection refused = down") passes while the app returns 500 on every real request.
- A check that pings
/(full page) hits the DB on every probe and times out under load. timeoutshorter than the endpoint's p99 flaps nodes out during traffic spikes, shrinking capacity exactly when you need it.- A
200 OKreturned by a catch-all error handler masks a dead dependency. - Thresholds set per target group but a second target group (the one for HTTP/2 or a different port) left at defaults.
- Health endpoint behind the same auth as the API returns 401 forever, marking everything down.
Verification
curl -sf -o /dev/null -w '%{http_code} %{time_total}\n' http://10.0.1.5:8080/healthz
aws elbv2 describe-target-health --target-group-arn "$TG" \
--query 'TargetHealthDescriptions[].TargetHealth.State'
Pass means the endpoint returns 200 in under the configured timeout and every target reads healthy.
Report: "Timeout raised 1s→5s (p99 2.1s), interval 10s, unhealthy 3; flapping stopped."
04 同仓库更多 Skills
troves
Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.
trade
Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".
staking
Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.
send
Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".
portfolio
View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".
multi-swap
Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.