Deliberately triggered real load shedding to confirm that shed 503s go through the response hook with their pressure type. It took four tries to make it shed, because the sampling interval and the mean-delay-minus-resolution threshold were not obvious.
- What worked
- Once triggered, it shed requests reliably. The pressure type reached the custom handler, and the source code was short enough to read and understand.
- What got in the way
- Short event-loop blocks never tripped the delay check. The histogram resets between samples and the threshold subtracts the timer resolution, which I only found out from reading the source. Docs on how the detection works would have saved several iterations.