Production Latency Issue – Elevated Azure AI Search Query Latency from AKS (Request for Investigation + Call)

Sreshta Talluri 0 Reputation points
2026-06-22T19:13:18.65+00:00

Description

We are observing consistently elevated query latency when calling our Azure AI Search service from our production AKS environment, compared to local testing. This is impacting production performance, and we would like assistance investigating potential causes and scheduling a live troubleshooting session.


Details

Service: Azure AI Search

Tier: Standard S1

Region: West US 2

Access Method: Azure REST API

Client Environment: Azure Kubernetes Service (AKS) – Production

Network Setup: Private endpoints configured; connectivity verified


Observed Behavior

From local testing environments, query latency is typically ~100–200 ms. (for our specific query with filters and everything)

From AKS production workloads, the same queries consistently take ~500 ms or higher.

The same: Search service, Index, Query payloads, API endpoints are being used in both environments.


Recent Mitigations Attempted

Optimized DNS resolution by resolving and pinning IP addresses where applicable.

Verified private endpoint connectivity and routing.

Confirmed no differences in query structure or payloads between environments.

Despite these efforts, the latency discrepancy persists.


Expected Behavior

We expect query latency from AKS (within Azure) to be comparable to or better than local testing, especially given proximity to the service region and private networking setup.


Impact

This issue is affecting production application performance.

Increased latency is impacting end-user experience and system responsiveness.


Request for Support

We would appreciate help with:

Root Cause Investigation

  • Potential causes of higher latency from AKS (network routing, SNAT, DNS, private endpoint behavior, etc.)
    • Any service-side factors affecting request processing latency

Diagnostics

  • Guidance on identifying whether latency is:
  • Client-side (AKS networking)
  • Azure network path
- Azure AI Search service processing

- Any available logs, metrics, or diagnostic tools on the Azure side

Best Practices

  • Recommendations for optimizing latency from AKS to Azure AI Search
    • Validation of our private endpoint and DNS approach

Request for Live Session

Given the production impact and complexity of the issue, we would like to schedule a live troubleshooting call with the engineering/support team to:

Walk through our architecture

Share timing breakdowns and logs

Collaborate on real-time diagnostics

We are available for a call at your earliest convenience and can provide additional artifacts (trace IDs, request logs, metrics) ahead of time.

Azure AI Search
Azure AI Search

An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.


2 answers

Sort by: Most helpful
  1. Anshika Varshney 15,625 Reputation points Microsoft External Staff Moderator
    2026-06-22T19:23:57.83+00:00

    Hello @Sreshta Talluri

    Thanks for sharing the details. Based on the symptoms, I’d suggest separating service-side latency from client/network-side latency first, since Azure AI Search can look slow even when the backend processing time is healthy.

    A few things that are worth validating in your AKS setup:

    • Measure the raw search latency from inside the pod, and compare it with the end-user observed latency. If server time is low but end-to-end time is high, the issue is likely network, DNS, TLS, or connection reuse rather than the search service itself.[stackoverflow]
    • Reuse the search client and HTTP connections instead of creating a new client per request, because connection setup overhead can add significant latency.
    • Check whether query spikes, throttling, or concurrent indexing are happening at the same time as the latency increase. Azure guidance notes that excess load or throttling can cause short periods of slow queries. [learn.microsoft]
    • Review query shape: reduce returned fields, avoid large result sets, simplify filters, and limit the number of searchable fields where possible. [techcommunity.microsoft]
    • If the service is already near capacity, consider adding replicas or moving to a higher tier; partitions can also help depending on workload pattern. [stackoverflow]

    If you share whether the latency is only from AKS, only on first query, or across all clients, that will narrow it down a lot.

    I Hope this helps. Do let me know if you have any further queries.

    Thankyou!

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-06-22T19:13:48.8133333+00:00

    The latency gap between local calls and AKS calls to Azure AI Search can be broken down and investigated using the built‑in metrics and techniques for Azure AI Search, plus standard AKS diagnostics. The key is to separate:

    1. Time spent in the Azure AI Search service
    2. Time spent on the network path (AKS → Search)
    3. Time spent in the client (container, SDK, retries, etc.)

    Below is a concrete investigation path and optimization guidance based on the documented behavior of Azure AI Search.


    1. Measure server vs. network latency per query

    Use the Azure AI Search REST response headers to distinguish service processing time from end‑to‑end latency:

    1. From an AKS pod, run the exact same REST query using a REST client (for example, curl or a simple test container) and inspect the HTTP response headers.
    2. In the response, locate the elapsed-time header (milliseconds). This is the time Azure AI Search took to execute the query inside the service.
    3. Compare it to the total round‑trip time reported by the client (for example, your HTTP client’s timing or the REST tool’s reported duration).

    The difference between round‑trip time and elapsed-time is the network + client overhead. For example, if:

    • elapsed-time ≈ 150 ms
    • Round‑trip from AKS ≈ 500 ms

    Then ~350 ms is outside the search service and must be investigated in AKS networking or client behavior.

    This technique is explicitly recommended to isolate network latency from service processing latency.

    “Azure AI Search includes in every response the number of milliseconds it takes to complete the query, visible in the Headers tab, in elapsed-time… Using these two values… we see the search service took 21 ms… and the entire client round-trip request took 125 ms. By subtracting these two numbers we can determine that it took 104-ms additional time to transmit the search query to the search service and to transfer the search results back to the client.”

    Repeat this measurement:

    • From local environment → Search
    • From AKS → Search

    This will show whether the extra ~300–400 ms is in the service or in the network/client path from AKS.


    In the Azure portal for the search service:

    1. Go to MonitoringMetrics.
    2. Inspect Search Latency:
      • Look at average, max, and distribution during the time windows when AKS traffic is active.
      • If Search Latency is low (similar to local tests), the service is not the bottleneck.
    3. Inspect Throttled queries (ThrottledSearchQueriesPercentage):
      • If throttling is occurring, clients may be experiencing retries and backoff, which increases effective latency.

    “Service-wide, query performance is measured as search latency and throttled queries. These metrics are also available on the Monitoring tab.”

    If you see:

    • Low Search Latency but high end‑to‑end latency from AKS → focus on AKS networking and client behavior.
    • Elevated Search Latency during AKS load windows → the service is under heavier load when AKS is active.

    3. Analyze load, indexing, and background processing

    Higher latency from AKS may coincide with higher query volume or indexing activity coming from production workloads.

    1. Use the Kusto‑based queries from the Azure AI Search performance analysis guidance to visualize:
      • Average Query Latency over time
      • Queries Per Minute (QPM)
      • Indexing Operations Per Minute (OPM)
    2. Correlate spikes in latency with:
      • Spikes in QPM (query load)
      • Spikes in OPM (indexing load)

    “Indexing uses the same resources as search queries. If you're indexing a large amount of content, you can expect to see latency grow as the service tries to accommodate both workloads.”

    “Spikes might occur in response to indexing or high query rates, but could also occur during merge operations… Merging shards is fast, but also resource intensive and thus has the potential to degrade service performance.”

    If AKS production is driving:

    • Higher sustained QPS than local tests, or
    • Concurrent heavy indexing,

    then the service may be closer to capacity under AKS load, causing higher latency.

    Actions if this is observed:

    • Temporarily pause or reschedule heavy indexing away from peak query times.
    • Consider capacity adjustments (replicas/partitions or tier) per the capacity planning guidance referenced in the performance article.

    4. Distinguish AKS networking issues

    Once service‑side metrics show whether the search service itself is fast or slow, focus on AKS networking if elapsed-time is low but end‑to‑end latency is high from AKS only.

    Use the same measurement pattern as for AKS API server diagnostics: measure latency per client and over time.

    From AKS:

    • Run repeated REST calls to the search endpoint from a test pod and log:
      • Start time and end time
      • elapsed-time header
      • Any HTTP status codes (especially 429 or 503)

    From local:

    • Run the same script and compare distributions.

    This mirrors the approach used in AKS API server diagnostics, where Kusto queries are used to compute average latency per user agent over time.

    “To identify the average latency of API server requests per user agent, as plotted on a time chart, run the following query… extend latency… summarize avg(latency) by UserAgent, bin(start_time, 5m).”

    While that specific query is for AKS API server, the same pattern (compute per‑client average latency over time) can be applied to your own logs for calls from AKS to Azure AI Search.

    If AKS shows consistently higher network latency to the search endpoint than local, this indicates a networking path or configuration issue (for example, private endpoint routing, SNAT, or other infrastructure). That part would be investigated with Azure networking support.


    5. Plan for query spikes and client behavior

    If AKS production traffic is bursty, ensure that client behavior is not amplifying latency:

    • Check for 429 responses from Azure AI Search (Too Many Requests). When the system reaches capacity, it returns 429s and expects clients to back off.
    • Ensure the client implements proper backoff and retry logic (for example, exponential backoff with jitter) so that retries do not create a “retry storm” that increases latency.

    “Latency stays low when the load is moderate, and gradually increases as you approach the maximum QPS capacity. When the system reaches 100% QPS capacity, it starts returning 429 errors… As a best practice… If you use the REST API, implement exponential backoff with jitter.”

    If AKS clients are aggressively retrying without backoff, effective latency will be much higher than the underlying service latency.


    6. Best‑practice checklist for optimizing latency from AKS

    Based on the documented behavior of Azure AI Search:

    1. Measure and monitor
      • Use elapsed-time vs. client round‑trip to separate service vs. network latency.
      • Monitor Search Latency and Throttled queries in the portal.
      • Use Kusto‑based queries for QPM and OPM to correlate load with latency.
    2. Control indexing and background load
      • Avoid heavy indexing during peak query periods.
      • Be aware that shard merge operations after indexing can cause short latency spikes.
    3. Stay below critical QPS limits
      • Monitor QPM/QPS from AKS workloads.
      • Implement exponential backoff with jitter for REST clients to avoid retry storms.
    4. Validate AKS networking path
      • Compare elapsed-time and round‑trip from AKS vs. local.
      • If service latency is low but AKS round‑trip is high, engage networking diagnostics (VNet, private endpoint routing, SNAT, etc.) with Azure support.

    7. Live troubleshooting session

    For a live call with engineering/support to walk through architecture, timings, and logs, open a support request through the Azure portal for the Azure AI Search resource and attach:

    • Example queries and headers (including elapsed-time).
    • Metrics screenshots for Search Latency and Throttled queries.
    • QPM/OPM charts around the time windows with elevated latency.
    • AKS‑side measurements showing the difference between local and AKS round‑trip times.

    Support can then correlate your correlation IDs and timestamps with backend telemetry and, if needed, involve networking teams to investigate the AKS → Search path.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.