‹

05. Timeouts and Retries — The Cure That Causes the Disease

05. Timeouts and Retries — The Cure That Causes the Disease

05. ​การหมดเวลา​และ​การลอง​ใหม่ — ​ยา​ที่​กลายเป็น​ต้นเหตุ​ของ​โรค

The Paradox of Recovery Logic

​ปฏิทรรศน์​ของ​ตรรกะ​การกู้​คืน

Retry mechanisms are intended to improve reliability by masking transient faults within a distributed system, yet they frequently serve as the primary catalyst for total collapse. In the 2015 DynamoDB US-East disruption, Amazon Web Services documented how automated retry logic inadvertently transformed a localized issue into a sustained, system-wide service failure. When individual storage servers began retrying membership requests against an overloaded metadata service, they created a positive-feedback loop that overwhelmed the already struggling infrastructure components. This specific event showed that the retry logic itself was the mechanism keeping the system in a degraded state, rather than a bridge to recovery. By maintaining a ~55% error rate for customers, the system demonstrated that blindly reapplying requests can exacerbate rather than resolve the underlying resource exhaustion.

​การลอง​ใหม่​กลายเป็น​ตัวเร่ง​หลัก​ที่​ทำให้​ระบบ​ล่ม​ทั้ง​ระบบ​อยู่​บ่อยครั้ง ​ทั้งที่​มัน​ถูก​ออกแบบ​มา​เพื่อ​เพิ่ม​ความน่าเชื่อถือ ​ด้วย​การกลบ​ความผิดพลาด​ชั่วคราว​ใน​ระบบ​กระจาย​ศูนย์​ไว้ ​ปี 2015 ​ระบบ DynamoDB ​ขัดข้อง ​และ Amazon Web Services ​บันทึก​ไว้​เอง​ว่า​ตรรกะ​การลอง​ใหม่​แบบ​อัตโนมัติ​เปลี่ยน​ปัญหา​เฉพาะ​จุด​ให้​กลายเป็น​บริการ​ล้มเหลว​ทั่ว​ทั้ง​ระบบ​อย่าง​ยืดเยื้อ ​โดย​ไม่​มี​ใคร​ตั้งใจ ​เซิร์ฟเวอร์​จัดเก็บ​ข้อมูล​แต่ละ​เครื่องส่ง​คำร้องขอ​สมาชิกภาพ​ซ้ำ​ไป​ยัง​บริการ​เม​ทา​ดา​ตา​ที่​รับภาระ​เกินกำลัง​อยู่แล้ว ​ผล​คือ​วงจร​ป้อน​กลับ​เชิง​บวก ​ที่​ถาโถม​ใส่​ส่วนประกอบ​ของ​โครงสร้างพื้นฐาน​ที่​กำลัง​แย่​อยู่​ก่อน​แล้ว ​เหตุการณ์​นี้​ชี้​ว่า​ตรรกะ​การลอง​ใหม่​นั่นเอง​คือ​กลไก​ที่​ตรึง​ระบบ​ไว้​ใน​สภาวะ​เสื่อม​ประสิทธิภาพ ​ไม่​ใช่​สะพาน​ไป​สู่​การกู้​คืน ​อัตรา​ข้อผิดพลาด​ค้าง​อยู่​ที่ ~55% ​สำหรับ​ลูกค้า ​ตัวเลข​นั้น​บอก​ว่าการ​ส่ง​คำร้องขอ​ซ้ำ​โดย​ไม่​ดู​สภาพ​ระบบ ​อาจ​ทำให้​ทรัพยากร​ที่​ขาดแคลน​อยู่แล้ว​ยิ่ง​ขาด​หนัก​ขึ้น ​แทนที่จะ​แก้​ให้หาย

Metastable Failures and Load Shedding

​ความล้มเหลว​แบบ​กึ่ง​เสถียร​และ​การลด​ภาระ​งาน

A metastable failure occurs when a system remains stuck in a high-latency or high-error state long after the initial triggering condition has been removed. Nathan Bronson, Abutalib Aghayev, Aleksey Charapko, and Timothy Zhu argued in their 2021 HotOS paper that these retry-driven loops are a defining characteristic of modern distributed systems. The 2015 AWS DynamoDB postmortem provides the definitive case study, illustrating how the metadata service could only recover once the team manually paused all incoming requests. This act of load shedding—deliberately rejecting work to protect the service—proved far more effective than the automated retries that had previously sustained the outage. To prevent the thundering-herd variant of this problem, engineers often implement exponential backoff with full jitter, calculating delay as random(0,1) multiplied by the min(cap, base x 2^attempt). Marc Brooker, writing for the AWS Architecture Blog in 2015, established this formula as the standard industry mitigation for preventing clients from synchronizing their retry attempts.

​ความล้มเหลว​แบบ​กึ่ง​เสถียร​คือ​ระบบ​ที่​ยัง​ติด​อยู่​ใน​สภาวะ​หน่วง​สูง​หรือ​ผิดพลาด​สูง ​ทั้งที่​เงื่อนไข​ที่​จุดชนวน​ถูก​กำจัด​ไป​นาน​แล้ว Nathan Bronson, Abutalib Aghayev, Aleksey Charapko ​และ Timothy Zhu ​โต้แย้ง​ไว้​ใน​เอกสาร HotOS ​ปี 2021 ​ว่า​วงจร​ที่​ขับเคลื่อนด้วย​การลอง​ใหม่​แบบนี้​คือ​ลักษณะเฉพาะ​ที่​นิยาม​ระบบ​กระจาย​ศูนย์​สมัยใหม่ ​กรณีศึกษา​ที่​ชัด​ที่สุด​คือ​รายงาน​ชันสูตร​เหตุขัดข้อง​ของ AWS DynamoDB ​ปี 2015 ​บริการ​เม​ทา​ดา​ตา​กู้​คืน​ได้​ก็ต่อเมื่อ​ทีมงาน​ลงมือ​ระงับ​คำร้องขอ​ขาเข้า​ทั้งหมด​ด้วยมือ​เท่านั้น ​นั่น​คือ​การลด​ภาระ​งาน ​ปฏิเสธ​งาน​โดยตั้งใจ​เพื่อ​รักษา​บริการ​ไว้ ​และ​มัน​ได้ผล​กว่า​การลอง​ใหม่​แบบ​อัตโนมัติ​ที่​ต่อ​ลมหายใจ​ให้​เหตุขัดข้อง​มา​ก่อนหน้า​นั้น​มาก ​ปัญหา​อีก​รูปแบบ​หนึ่ง​คือ​ฝูงชน​แห่​เข้ามา​พร้อมกัน ​วิศวกร​มัก​กัน​ไว้​ด้วย​การถอย​เวลา​แบบ​ทวีคูณ​พร้อม​การสุ่ม​เต็ม​รูปแบบ ​คือ​หน่วงเวลา​เท่ากับ random(0,1) ​คูณ​ด้วย min(cap, base x 2^attempt) Marc Brooker ​เขียน​ไว้​ใน AWS Architecture Blog ​ปี 2015 ​และ​วาง​สูตร​นี้​เป็นมาตร​ฐาน​การบรรเทา​ปัญหา​ของ​อุตสาหกรรม ​เพื่อ​กัน​ไม่​ให้​ไคลเอนต์​ลอง​ใหม่​พร้อมกัน​เป็นจังหวะ​เดียว

The Consensus on Retry Risks

​ฉันทา​มติ​เกี่ยวกับ​ความเสี่ยง​ของ​การลอง​ใหม่

There is no serious dispute regarding the danger of unconstrained retry loops, as the evidence from both academic research and operational postmortems aligns perfectly. Bronson et al. cite multiple industry incidents that mirror the DynamoDB failure, confirming that the pattern of retry amplification is a systemic, repeatable phenomenon. The field currently accepts that safety is a control problem requiring explicit load management rather than a simple component problem solvable by retrying.

​อันตราย​ของ​วงจร​ลอง​ใหม่​ที่​ไร้​การควบคุม​ไม่​มี​ข้อโต้แย้ง​ที่​สำคัญ​เหลืออยู่ ​หลักฐาน​จาก​งานวิจัย​ทางวิชาการ​และ​รายงาน​ชันสูตร​เหตุขัดข้อง​จาก​หน้า​งาน​ตรงกัน​ทั้งหมด Bronson ​และ​คณะ ​อ้าง​ถึง​เหตุการณ์​ใน​อุตสาหกรรม​หลายครั้ง​ที่​ซ้ำรอย​ความล้มเหลว​ของ DynamoDB ​และ​ยืนยัน​ว่าการ​ขยายตัว​ของ​การลอง​ใหม่​เป็น​ปรากฏการณ์​เชิง​ระบบ​ที่เกิด​ซ้ำ​ได้ ​ปัจจุบัน​สาขา​นี้​ยอมรับ​แล้ว​ว่าความ​ปลอดภัย​เป็นปัญหา​เชิง​ควบคุม ​ต้อง​จัดการ​ภาระ​งาน​อย่าง​ชัดแจ้ง ​ไม่​ใช่​ปัญหา​ของ​ส่วนประกอบ​ชิ้น​เดียว​ที่​ลอง​ใหม่​แล้ว​จบ

Example: Retrying a failed request in an overloaded system is like pouring more water into a clogged drain, hoping the pressure will clear the pipe.

​ตัวอย่าง: ​ส่ง​คำร้องขอ​ที่​ล้มเหลว​ซ้ำ​ใน​ระบบ​ที่​ภาระ​งาน​ล้นมือ ​ก็​เหมือน​เท​น้ำ​เพิ่ม​ลง​ท่อระบายน้ำ​ที่​ตัน ​แล้ว​หวัง​ว่า​แรงดัน​จะ​ดัน​สิ่ง​อุดตัน​ให้​หลุด

Verdict. Aggressive retry logic is a leading cause of large-scale, self-sustaining outages and should be replaced by load shedding during periods of high contention.

​คำตัดสิน. ​ตรรกะ​การลอง​ใหม่​ที่​ก้าวร้าว​เกินไป​คือ​สาเหตุ​อันดับ​ต้น​ของ​เหตุขัดข้อง​ขนาดใหญ่​ที่​หล่อเลี้ยง​ตัวเอง​ได้ ​และ​ควร​ถูก​แทนที่​ด้วย​การลด​ภาระ​งาน​ใน​ช่วง​ที่​แย่งชิง​ทรัพยากร​กัน​สูง

Overturned if: A large-scale system demonstrates that unconstrained retries under extreme load consistently lead to faster recovery times than load shedding or backoff strategies.

​จะ​พลิก​คำตัดสิน​ได้​เมื่อ: ​มีระบบ​ขนาดใหญ่​แสดงให้เห็น​ว่าการ​ลอง​ใหม่​โดย​ไร้​การควบคุม​ภายใต้​ภาระ​งาน​สุดขั้ว ​กู้​คืน​ได้​เร็ว​กว่า​การลด​ภาระ​งาน​หรือ​กลยุทธ์​การถอย​เวลา​อย่าง​สม่ำเสมอ

Sources. 2021 · Nathan Bronson, Abutalib Aghayev, Aleksey Charapko, Timothy Zhu, "Metastable Failures in Distributed Systems" — paper PDF · 2015 · Amazon Web Services, "Summary of the Amazon DynamoDB Service Disruption and Related Impacts in the US-East Region" — AWS postmortem

​แหล่ง​อ้างอิง. 2021 · Nathan Bronson, Abutalib Aghayev, Aleksey Charapko, Timothy Zhu, "Metastable Failures in Distributed Systems" — paper PDF · 2015 · Amazon Web Services, "Summary of the Amazon DynamoDB Service Disruption and Related Impacts in the US-East Region" — AWS postmortem

บทถัดไป · 6 / 1206. The Silent Success — Failure That Reports Everything Is Fine
Size
Page
Font

At The Seams

❦
101. The Seam — Why Failure Concentrates Where Parts Meet01. รอยต่อ — เหตุใดความล้มเหลวจึงกระจุกตัว ณ จุดที่ส่วนประกอบมาบรรจบกัน202. Units and Assumptions — The Mismatch Nobody Owns02. หน่วยวัดและข้อสมมติฐาน — ความไม่เข้ากันที่ไม่มีใครรับผิดชอบ303. The Handoff — Where Information Goes to Die03. การส่งต่องาน — จุดที่ข้อมูลมักสูญหาย404. Protocol Drift — When Two Sides Disagree About the Contract04. การเบี่ยงเบนของโปรโตคอล — เมื่อสองฝ่ายมีความเห็นไม่ตรงกันเรื่องสัญญา505. Timeouts and Retries — The Cure That Causes the Disease05. การหมดเวลาและการลองใหม่ — ยาที่กลายเป็นต้นเหตุของโรค606. The Silent Success — Failure That Reports Everything Is Fine06. ความสำเร็จที่เงียบงัน — ความล้มเหลวที่รายงานว่าทุกอย่างเรียบร้อยดี707. Latent Conditions — Accidents That Were Already There07. เงื่อนไขแฝง — อุบัติเหตุที่ดำรงอยู่ก่อนแล้ว808. The Blame Reflex — Why 'Human Error' Ends the Inquiry08. ปฏิกิริยาตอบสนองด้วยการกล่าวโทษ — เหตุใด 'ความผิดพลาดของมนุษย์' จึงเป็นจุดจบของการสืบสวน909. The Postmortem — Turning an Outage Into an Asset09. การชันสูตรเหตุขัดข้อง — การเปลี่ยนเหตุการณ์หยุดชะงักให้เป็นสินทรัพย์1010. Resilience Engineering — Work as Imagined and Work as Done10. Resilience Engineering — งานอย่างที่คิดว่าทำ และงานอย่างที่ทำจริง1111. Control, Not Components — Leveson's Reframing11. การควบคุม ไม่ใช่ส่วนประกอบ — การปรับกรอบแนวคิดของ Leveson1212. Finding Your Own Seams — The Procedure12. การค้นหารอยต่อของคุณ — ขั้นตอนการปฏิบัติ