Page MenuHomePhabricator

Unexpected changes in search latency
Closed, ResolvedPublic

Description

During our regular check of our performance metrics, we noticed that the search latency seems to have gone up substantially:

image.png (606×314 px, 19 KB)
.

What that metrics measures seems to mainly be the latency of SearchEngine::searchText calls done in LocalSearchTaskSuggester::search.

It is unclear if that change has a noticeable impact for users. The place where it could have an impact is when changing topics / task types on the homepage and thus search for more tasks using the growthtasks generator / ApiQueryGrowthTasks. Ideally, we would have latency data for that api-endpoint, but currently we do not.

Acceptance criteria:

Event Timeline

Probable cause: In context of T388610: Migrate production Elastic clusters to Opensearch, search traffic was rerouted to codfw, see https://sal.toolforge.org/log/Wp_0rpYB8tZ8Ohr0AONU and cirrus: explicitly route search traffic to codfw.

In turn, this might be a contributing factor to, or maybe even the whole cause of, the delay in the listTaskCounts maintenance script that we obsever in T394018: Link Recommendation Task pool data missing for some wikis.

@Michael can we move this to the maintenance board or the tracking column if we're waiting for more data in relation to T388610: Migrate production Elastic clusters to Opensearch?

@Michael can we move this to the maintenance board or the tracking column if we're waiting for more data in relation to T388610: Migrate production Elastic clusters to Opensearch?

Let's move it to maintenance for now, that sounds like the right place.

Michael renamed this task from Unexpected increase in increase in search latency to Unexpected increase in search latency.Jun 23 2025, 7:35 AM
Michael renamed this task from Unexpected increase in search latency to Unexpected changes in search latency.Jun 23 2025, 7:38 AM

It seems to have gone down again to an even lower value. Still not clear how or why or:

image.png (603×319 px, 30 KB)

Discovery-Search: if there were changes by you recently-ish that could have caused this, then it would be nice to understand. That being said, I don't think that these changes in latency by themselves require action at this point.

Search traffic moved between datacenters due to operational concerns, this causes latency effects as noted in the above. The latency difference is ~30ms per round trip to the search servers if the requests have to go cross-datacenter. Typically there are 2 round trips but that can vary for a number of reasons.

Search traffic moved between datacenters due to operational concerns, this causes latency effects as noted in the above. The latency difference is ~30ms per round trip to the search servers if the requests have to go cross-datacenter. Typically there are 2 round trips but that can vary for a number of reasons.

Thanks, that is good to know! We see the effects of this pretty directly in our metrics. I'll add a note to the affected panels, but otherwise I don't think there is much more to do here.

Is there a Phabricator project against which these moves of traffic between datacenters are usually tagged? Then we could check that first ourselves the next time we see our latencies jump abruptly without us doing anything.

There isn't any particular phabricator task for tracking where search traffic currently flows to, i suppose it's tracked in config-master discovery but that's not human readable. The shift in traffic above was part of T370147. There will potentially be a similar shift when we move to opensearch 2, but thats probably 6+ months away. In general it's not particularlly common that we have to disable one of the two search clusters, but it happens from time to time.

Michael claimed this task.

There isn't any particular phabricator task for tracking where search traffic currently flows to, i suppose it's tracked in config-master discovery but that's not human readable. The shift in traffic above was part of T370147. There will potentially be a similar shift when we move to opensearch 2, but thats probably 6+ months away. In general it's not particularlly common that we have to disable one of the two search clusters, but it happens from time to time.

That makes sense, thanks!

I think we can close this now, nothing left here to do.