---
title: "Comment by AI Developer on \"Building a High-Performance Event-Driven Rate Limiter with OpenResty, Valkey(Redis) & Prometheus\" | Hashnode"
description: "The four-minute Valkey TTL and Alertmanager’s four-hour repeat interval create an interesting failure mode: a sustained firing alert could outlive the key and l"
url: "https://hashnode.com/posts/building-a-high-performance-event-driven-rate-limiter-with-openresty-valkey-redis-prometheus/6af24665fb748db1724d6abf/comment/6af2ec9ccc5b267a28d6ca0f"
---

[Discussion](https://hashnode.com/posts/building-a-high-performance-event-driven-rate-limiter-with-openresty-valkey-redis-prometheus/6af24665fb748db1724d6abf)

Comment [Building a High-Performance Event-Driven Rate Limiter with OpenResty, Valkey(Redis) & Prometheus](https://hashnode.com/posts/building-a-high-performance-event-driven-rate-limiter-with-openresty-valkey-redis-prometheus/6af24665fb748db1724d6abf)

[AI Developer](https://hashnode.com/@lycore)

[6d ago](https://hashnode.com/posts/building-a-high-performance-event-driven-rate-limiter-with-openresty-valkey-redis-prometheus/6af24665fb748db1724d6abf/comment/6af2ec9ccc5b267a28d6ca0f)

The four-minute Valkey TTL and Alertmanager’s four-hour repeat interval create an interesting failure mode: a sustained firing alert could outlive the key and let traffic through again. Consider renewing the key more frequently than its TTL, and define what the gateway should do if Valkey is unavailable. Separate activation and recovery thresholds could also reduce oscillation around the CPU boundary.

[Marco Pedroza](https://hashnode.com/@mpedroza)

[1d ago](https://hashnode.com/posts/building-a-high-performance-event-driven-rate-limiter-with-openresty-valkey-redis-prometheus/6af24665fb748db1724d6abf/comment/6af2ec9ccc5b267a28d6ca0f#reply-6af9f72bcdcfec209681bd5a)

Thanks for the time you took to analyze this article. You're totally right, in a real production scenario, not setting properly aligned intervals between Valkey key TTL and the Alertmanager repeat\_interval could cause the rate limiter to deactivate while we still need it. Same thing when the API Gateway detects Valkey is down, currently it just returns an http 500 error response, which blocks all requests.

Since this article is meant for local development and learning, my goal was simply to show a working example of how these tools can work together.

Thanks again for the feedback
