Skip to content

[Bug]: Short Server turns incur excessive database round trips with a remote MatrixOne database #980

Closed as not planned

Description

@gouhongshen

Existing issue

  • Searched existing issues; no matching short-turn remote-database latency issue found.

Version and environment

Astra 0.2.11, main commit 2873a95; Server-only, macOS arm64. Synthetic sessions in an isolated MatrixOne account. Real OpenAI-compatible provider; no Memoria, Edge, or MOI runtime.

Actual behavior

Ten fresh-session hi turns with Explain enabled take 10.59–15.83 seconds from POST /chat/stream to the completed run_finished event (nearest-rank P90: 14.22 seconds). Each completes one model round with zero tool calls. SQL tracing shows many serial admission, live-event, and terminal-settlement round trips, alongside concurrent background polling. Concurrent SQL elapsed sums are not treated as foreground wall time.

Expected behavior

Reduce avoidable serial database work while preserving authentication, deletion/owner-generation fences, canonical context, billing, durable event ordering, approvals, cancellation, reconnect/replay, and settlement readiness. Target complete-turn P90 below 7 seconds with the same remote database and model; do not special-case greetings or disable normal functionality.

Reproduction

  1. Start the same astra-server binary against an isolated remote MatrixOne account.
  2. Configure a single active OpenAI-compatible offering and low adaptive effort.
  3. Send hi to POST /chat/stream with explain=true, max_output_tokens=4096 and skill auto-routing disabled; use a fresh session for each sample.
  4. Measure the complete stream through the completed run_finished event, not time to first token.
  5. Repeat at least 30 times after improvements; retain failed and slow samples.

Additional information

Three earlier matched local-database controls completed in 11.61 seconds cold and 2.45/3.53 seconds warm. This comparison motivates database-round-trip investigation, but does not isolate engine performance from topology/version effects. No customer data, production credentials, or existing production Astra tables are modified by the experiment.

Activity

  1. added
    kind/bug
    on Oct 12, 2026
  2. XuPeng-SH commented on Oct 20, 2026

    @XuPeng-SH
    Collaborator

    The reported 10-turn remote-DB baseline predates merged latency work (#999, #1026, #1027). This remains potentially high impact, but the next step should be a matched 30+ sample run against current main and the same isolated remote MatrixOne setup, retaining slow and failed samples. Re-establish the P90 before adding query batching or changing settlement/readiness guarantees.

  3. XuPeng-SH commented on Nov 13, 2026

    @XuPeng-SH
    Collaborator

    Consolidating into #1119. The remote-MatrixOne real-provider scenario, its historical P90 and its distinct below-7-second target are retained in #1119 alongside the original issue and reproduction. Consolidating tracking does not claim that the current-main latency target has been met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions