6 network và Nginx failure drills
Dùng namespaces/containers local; không packet-capture dữ liệu production.
6 failure drills
Lab 01 · Namespace route/NAT path
Tạo client/proxy/app namespaces bằng veth/bridge, routes và DNAT/SNAT; dùng ip route get/neigh/conntrack. Phá route, neighbor và asymmetric return; gate: packet path diagram + exact failing hop.
Lab 02 · Socket lifecycle và port pressure
Tạo short-lived outbound connections, quan sát SYN/ESTABLISHED/FIN/TIME_WAIT, FD và ephemeral range; tái hiện limit nhỏ rồi sửa pooling/keepalive/concurrency. Gate: throughput/recovery không tăng limits mù.
Lab 03 · Backlog, loss và PMTU
Làm listener accept chậm và nhỏ backlog; inject latency/loss/MTU issue. Dùng ss/nstat/tcpdump phân biệt SYN retransmit, accept queue, data retransmit và PMTU. Gate: counters + capture timestamped.
Lab 04 · Nginx upstream failure
Ba upstream có latency/error khác; so round-robin/least_conn/keepalive/passive fail/retry. Gửi idempotent và non-idempotent requests; gate: không duplicate effect và bounded 502/504 recovery.
Lab 05 · TLS, cache và forwarded trust
Rotate SNI certificate không downtime; test protocol/chain. Tạo cache key leak/stampede rồi sửa key/lock/stale. Spoof client IP trước/sau trusted proxy. Gate: security/freshness evidence.
Lab 06 · Rate limit và overload tuning
Thiết kế limit_req/limit_conn keys, burst/delay; load slow clients/large headers/body/upstream slowdown. Đo workers/FD/buffers/temp disk/upstream times và tune. Gate: SLO/429/503 behavior và no secondary DB overload.
Rubric
| Mức | Tiêu chí |
|---|---|
| 1 | Reproduce và đọc socket/access logs. |
| 2 | Correlate packet/kernel/Nginx/upstream queues. |
| 3 · Senior | Safe retry/cache/trust/overload mitigation với verification. |