Commands icon
If icon
SlackIncomingWebhook icon
Schedule icon

Dragonfly In-Memory Cache Memory Saturation and Key Eviction Sentinel

Audits Dragonfly in-memory cache server statistics to detect high-frequency key eviction and cache thrashing.

Categories
DataInfrastructure

How it works

This workflow connects to a Dragonfly in-memory data store instance via standard Redis protocol (redis-cli) to query INFO stats for the evicted_keys counter. Dragonfly provides a multi-threaded, high-throughput drop-in replacement for Redis and Memcached. When memory limits configured by maxmemory are saturated, Dragonfly's DashTable cache engine forcibly evicts keys according to the configured eviction policy (e.g., volatile-lru, allkeys-lru). Sudden spikes in evicted keys indicate cache capacity exhaustion and cause severe cache penetration into primary databases. This sentinel tracks key evictions and alerts caching platform teams.

What you get

  • Real-time tracking of Dragonfly in-memory cache key eviction rates.
  • Protection against cache thrashing and downstream database overload.
  • Automated Slack incident notifications detailing total evicted keys.

Who it's for

  • Caching and Database Platform Engineers running high-throughput Dragonfly instances.
  • SREs safeguarding sub-millisecond API response latency.
  • Backend Architects managing multi-tenant key-value caching clusters.

Why orchestrate this with Kestra

  • Automated Metric Surveillance: Periodically inspects cache performance without custom agents.
  • Native Command Execution: Interacts directly with Dragonfly using standard Redis CLI commands.
  • Incident Orchestration: Notifies platform engineers directly in team collaboration channels.

Prerequisites

  • Dragonfly server accessible over network (6379).
  • Redis CLI tool installed in the runner container.
  • Secrets DRAGONFLY_PASSWORD and SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import this blueprint into your Kestra workspace.
  2. Add DRAGONFLY_PASSWORD and SLACK_WEBHOOK secrets.
  3. Specify dragonfly_host, dragonfly_port, and max_evicted_keys_rate.
  4. Enable the schedule trigger for continuous eviction surveillance.

How to extend

  • Query INFO memory to inspect used_memory_human and fragmentation ratios.
  • Trigger an automated memory capacity resize via cloud infrastructure APIs.
  • Route critical alerts to PagerDuty or Opsgenie.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.