---
title: "The Day Our Own Queries DoS’ed Us: Inside Zalando Search"
description: "A Zalando Elasticsearch cluster serving two large markets was overwhelmed by a self-inflicted denial of service: a bug in an internal maintenance workload made an application send only 20-100 requests per second of faceting queries aggregating on SKU, a unique-per-product, extremely high-cardinality field."
url: "https://swe.quest/articles/the-day-our-own-queries-dos-ed-us-inside-zalando-search-67652f0dd340b67a"
canonical: "https://engineering.zalando.com/posts/2025/12/we-hacked-ourselves-so-you-dont-have-to.html"
source: "Zalando Engineering"
published: "2025-12-16"
difficulty: "medium"
kind: "Incident"
reading_minutes: 10
tags: ["search","incident-response","resilience","observability","performance"]
---

# The Day Our Own Queries DoS’ed Us: Inside Zalando Search

A post on [Zalando Engineering](https://swe.quest/sources/zalando.md), published 2025-12-16, 10 min read, Incident. Original: [https://engineering.zalando.com/posts/2025/12/we-hacked-ourselves-so-you-dont-have-to.html](https://engineering.zalando.com/posts/2025/12/we-hacked-ourselves-so-you-dont-have-to.html)

## Summary

A Zalando Elasticsearch cluster serving two large markets was overwhelmed by a self-inflicted denial of service: a bug in an internal maintenance workload made an application send only 20-100 requests per second of faceting queries aggregating on SKU, a unique-per-product, extremely high-cardinality field. Because the traffic was low-volume, syntactically valid and untagged, it went unnoticed, and the usual mitigations (longer cache TTLs, scaling coordinator and data nodes, lower query termination thresholds) gave no relief. Splitting the markets via shard allocation isolated the problem, and trace analysis in Lightstep linked a 50x query spike from the internal client to the incident. High-cardinality terms aggregations run as heavy work on the shard-level search thread pool, not the parallel slice collectors, so a handful of them can saturate CPU and queues and starve normal traffic.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- Elasticsearch shards and replicas ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))
- terms aggregations
- thread pools and queueing

## Keywords

Elasticsearch, Zalando, Lightstep, Adaptive Replica Selection, terms aggregation

## Related posts

- [Interning at incident.io: rate limiting, resiliently](https://swe.quest/articles/interning-at-incident-io-rate-limiting-resiliently-703eb65d0ab42974.md): incident.io · 2026-09-02 · Medium · 10 min read · Resilience, Algorithms, Kubernetes, Engineering culture
  incident.io made its rate limiter keep working when its Valkey backing store (Google Cloud Memorystore) is unavailable, instead of failing open.
- [The search for speed in Figma](https://swe.quest/articles/the-search-for-speed-in-figma-06e4c11289fe0686.md): Figma · 2024-10-10 · Medium · 11 min read · Search, Performance engineering, Observability, Cost optimization, Cloud platforms
  Figma's search slowness traced mostly to its own stack, not OpenSearch: OpenSearch's headline 8 ms metric was per-shard time, and only the "took" field in responses reveals overall query latency, which accounted for under 30% of API time.
- [ClickHouse vs. Elasticsearch: The Billion-Row Matchup](https://swe.quest/articles/clickhouse-vs-elasticsearch-the-billion-row-matchup-227267b2f21c24e1.md): ClickHouse · 2024-05-07 · Medium · 28 min read · Analytics & OLAP, Performance engineering, Search, Databases, Observability
  On a single 32-core c6a.8xlarge node loaded with 1, 10 and 100 billion PyPI download rows, ClickHouse beats Elasticsearch on count(\*) GROUP BY aggregations (Elasticsearch terms aggregations).
- [Client-Side Load Balancing at a Million Requests Per Second](https://swe.quest/articles/client-side-load-balancing-at-a-million-requests-per-second-9bf178158e4acd04.md): Zalando Engineering · 2026-06-22 · Hard · 28 min read · Load balancing, Kubernetes, Caching, Scaling, Java & JVM
  Zalando moved the high fan-out internal traffic of its Product Read API (over a million requests per second at peak) off the shared Skipper ingress and onto an in-process client-side load balancer.
- [Failing to Auto Scale Elasticsearch in Kubernetes](https://swe.quest/articles/failing-to-auto-scale-elasticsearch-in-kubernetes-c5af95622c43445d.md): Zalando Engineering · 2024-06-20 · Medium · 6 min read · Kubernetes, Incidents & postmortems, Search, Capacity planning, Debugging
  A schedule-driven Elasticsearch cluster run by es-operator on Kubernetes repeatedly failed to scale out for the morning peak.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
