SLO/Search
Status: draft
Organizational
Service
Full-text search of wiki articles, article title autocompletion and MediaSearch.
Teams
Search Platform, a member of the Data Platforms working group, owns these services. The operational side is owned by Data Platforms SRE.
Architectural
Environmental dependencies
- CirrusSearch, a MediaWiki extension, forwards search queries to the OpenSearch clusters, which serve them.
- The Cirrus Streaming Updater, a Flink application, consumes page change events and writes them to the clusters.
Service dependencies
- MediaWiki depends on CirrusSearch being operational.
- CirrusSearch depends on the OpenSearch clusters being healthy and responsive.
Client-facing
Clients
Users submit queries on a given wiki. That wiki's MediaWiki processes query OpenSearch and display the results through the UI.
Request Classes
There are two request classes:
- Weighted tags queries: queries filtering on the
weighted_tagsfield, the "articles with suggestions" style queries that product teams build on. Filter shaped and markedly cheaper than ordinary search. - All other search queries: full text, autocomplete, more_like, MediaSearch and search preview.
Both classes count towards availability and update lag. Only the weighted tags class carries a latency objective: general query latency varies too much between query types to set one fair target, so the other class is for now ineligible for a latency guarantee. Per query type backend latency objectives are under discussion in task T355589.
Service Level Indicators (SLIs)
| Indicator | Objective | Measured[1] |
|---|---|---|
| Availability | 95% | 99.977% |
| Weighted tags query latency, within 250 ms | 95% | 98.1% |
| Update lag, within 10 minutes, per site | 95% | 99.8% eqiad, 98.1% codfw |
Availability: The percentage of all requests receiving a non-error response, defined as one that is not a CirrusSearch backend failure of class failed, memory_issue, config_issue or unknown (graph, row "Failures / Rejections").
- The fifth class,
rejected, is excluded:ElasticaErrorHandler::classifyError()uses it for queries the user malformed, which is the service working as intended. - All MediaWiki namespaces count, including maintenance traffic, because a search that fails is a failure wherever it came from.
- Both request classes count. Weighted tags queries are separated out for latency only, not here.
Weighted tags query latency: The percentage of all requests that complete within 250 milliseconds, measured at the server side, counting only searches that filter on the weighted_tags field (graph).
- The dimension comes from the
weighted_tagslabel added in task T434975. - All namespaces count except
mw-cronandmw-script, where a slow query only means a maintenance script runs longer. - Excluding
mw-cronmakes the objective harder rather than easier: it is both the largest and the fastest source of these queries.
Update lag: The percentage of time that the update lag of the search index stays within the desired threshold (currently, 10 minutes), per site (graph).
- Lag is the median event-time lag of the last batch of events the Cirrus Streaming Updater wrote to the clusters.
- It is a property of the indexing pipeline and is measured for the whole index, so the request class distinction does not apply to it.
Internal API traffic (mw-api-int) counts in all three indicators: the internal and external distinction is hard to draw, and it carries some live user traffic.
Query details
Where the Prometheus queries are not self-explanatory. The definitions are in slothslos, under search/.
- MediaWiki emits
mediawiki_CirrusSearch_*through statsd-exporter in Kubernetes; the Cirrus Streaming Updater emitsflink_*; the clusters are scraped aselasticsearch_*(the exporter predates the move to OpenSearch). - The latency SLI has no
type=matcher, because weighted tag queries arrive both astype="full_text"and, from MediaSearch on Commons, astype="complex_query". le="0.25": a threshold SLI can only use an existing histogram bucket edge. The shared statsd-exporter edges are 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30 and 60 seconds, so 250 ms is available and 200 ms is not.- Error classes are matched negatively (
type!="rejected"), so that a future class counts against us until we decide otherwise. search_cluster!="semanticsearch_test"drops the semantic search test cluster, excluded by name so that cluster-targeted queries stay in the denominator if any are ever configured.- Latency aggregates both sites; update lag is split per site, because each site runs its own Flink consumer and can fall behind on its own.
- The 10 minute threshold is part of the
search_sli_update_lag:boolrecording rule, not of the SLO definition. or vector(0)on the availability error query: the generated rules average the five minute error ratio across the window, and a bucket where the failure series is absent rather than zero would drop out of that average entirely.
Coverage and caveats
- Availability counts only requests that reached the clusters. Requests shed by the pool counter are rejected before that and appear in neither metric, though the user does get
cirrussearch-too-busy-error. Overload is one of the main ways search becomes unavailable to readers, so this should count. It needs no new instrumentation and is planned for the December to February quarter (task T440163); it will lower the measured figure a little without putting the objective at risk. - A shard timeout returns partial results inside a successful response, so a truncated result set counts as available. There is no metric for it, only a log line. It is overwhelmingly regex search, which is best effort.
- Update lag is a median, of one batch. Half the events in the measured batch are slower, and a long tail is not visible.
- Latency and availability are measured by MediaWiki, not by the clusters, so both include pool counter wait and the network round trip. Searches answered from cache never reach the histogram.
Measured sizes for each of these are in task T431145.
Operational
Monitoring
Dashboards are in the Search folder. The burn rate rules generated from slothslos open a task; they do not page.
There is no out-of-hours paging for this service, and that is what caps the realistic targets at 95%. Only core SRE carries a pager, and they do not know the search infrastructure well enough to mitigate a search outage without help. Data Platforms SRE and Search Platform do know it, but neither has an on-call rotation. So the time from breakage to a first responder is minutes during European and North American working hours, and up to the next working day outside them. A failure late on a Friday can go unattended until Monday morning, roughly 60 hours. That one scenario is 2.8% of a quarter by itself: nearly three times an entire 99% error budget, and over half of a 95% one. That is why the objectives leave as much room as they do.
Cluster health colour (elasticsearch_cluster_health_status) is deliberately not an SLI: a yellow cluster still serves searches.
Troubleshooting
Whoever responds comes from Data Platforms SRE or Search Platform and knows the internals, so there is normally no escalation step and no waiting for a developer. Expect minutes to about an hour for the common causes: an overloaded or wrongly depooled node, shard recovery after a restart, or a query pattern that saturates a pool. Expect a few hours for an index or mapping problem, where working out which wikis are affected takes longer than the fix. Runbooks:
Deployment
Most mitigations are not code changes. Cluster side actions — depooling a node, restarting a daemon, freezing or resuming writes — are cookbooks and take minutes once someone is at the keyboard. A MediaWiki configuration change, such as disabling a query feature or lowering a pool limit, needs a backport window; during the working day that is usually a wait of under two hours, and an incident justifies deploying outside the window. Reverting CirrusSearch code is the slowest path and the rarest.
These estimates matter far less than the monitoring gap above. Against a 60 hour unattended outage, the difference between a ten minute fix and a two hour fix does not move the targets.
Service Level Objectives
Realistic targets
95% for each of the three indicators, for both request classes where an objective applies.
The binding constraint is the monitoring gap, not the performance of the service. Steady state sits far inside the targets, as the table shows, but one unattended weekend outage has to fit in the budget. At 95% over a reporting quarter it does, with room left for a second, shorter incident. Derivation in task T431145.
Ideal targets
- Availability: 99.9%, about 2.2 hours of full unavailability per quarter. Search is directly user facing and has no degraded mode, so the question is what readers would tolerate, not what a dependent team needs. A few minutes of downtime passes largely unnoticed; an outage running for hours draws community reports. The service already performs better than 99.9% in steady state, so the entire distance from 95% to 99.9% is the price of having no out-of-hours response, not a reliability shortfall.
- Weighted tags query latency: 95% within 200 ms. 200 ms is what the Product Derived Data team originally asked for. It became 250 ms only because the shared histogram has no bucket edge at 200 ms (task T431145), not because anyone wanted a looser target. The measured p95 sits just above 200 ms, so this is a near term goal rather than an aspiration.
- Update lag: 99% within 10 minutes, per site. One site is currently below that, so unlike the other two this one is a real stretch.
Reconciliation
- The published objectives are the realistic ones, 95% throughout. The ideal targets above are not guaranteed.
- The gap between them is response time, not reliability. Closing it needs some form of out-of-hours coverage for search; no amount of work on the clusters will close it.
- Targets agreed with the Product Derived Data team as the requesting side, and reviewed by Data Platforms SRE, who set the namespace scoping (task T431145).
- Alerting is by task, not by page, for the reason given under Monitoring.
- The "all other search queries" class has no latency objective yet. Whether it should get backend latency objectives per query type is open in task T355589.
- Defined in slothslos under
search/, asquery-availability,weighted-tags-query-latency,update-lag-eqiadandupdate-lag-codfw.
- ↑ Measured over the 30 days to 2026-10-05, from 6.9 billion search requests. The weighted tags figure covers the 24 days since that label reached full volume, from 8.7 million requests, and is still provisional. Derivation and the fuller picture are in task T431145.