Skip to content

What replaces multiplexing? #6731

Open

Description

@reinux

Apologies in advance as there's probably a straightforward answer to this that I'm missing, but what's the best way now to run consecutive queries without waiting for previous queries? ie without waiting for a round trip.

Ideally, I'd like to be able to use await and Task.WhenAll a la Redis multiplexing, as I'm using F# and it has some constructs that make this particularly ergonomic.

Thanks!

Activity

  1. CodesInChaos commented on Nov 11, 2026

    @CodesInChaos

    Raw Npgsql supports batching. I'm not aware of a similar mechanism in EF Core.

  2. reinux commented on Nov 17, 2026

    @reinux
    Author

    I'm using raw npgsql, so that should work. Is pipelining a thing at all, or was that scrapped along with multiplexing?

  3. vonzshik commented on Nov 17, 2026

    @vonzshik
    Contributor

    Apologies in advance as there's probably a straightforward answer to this that I'm missing, but what's the best way now to run consecutive queries without waiting for previous queries? ie without waiting for a round trip.

    Other than writing a custom pipelining via channels (that is, having a single thread consuming incoming queries and then batching them together up to a point), yeah, there's probably no other good way to implement this without multiplexing (which from what I remember was removed due to it not scaling that well with cores, @roji should know better).

    From what I know libpq does have pipeline mode build-in, so maybe that's something we can explore as well? Though obviously that's going to be completely outside of ADO.NET.
    For now, marking as a feature to explore for future releases.

  4. added theissue type on Nov 17, 2026
  5. added this to the 11.0.0 milestone on Nov 17, 2026
  6. roji commented on Nov 17, 2026

    @roji
    Member

    Ideally, I'd like to be able to use await and Task.WhenAll a la Redis multiplexing, as I'm using F# and it has some constructs that make this particularly ergonomic.

    If you want to run multiple queries in parallel, then you currently need to have a separate NpgsqlConnection for each one; you can have a block opening a new connection and executing some query, and then do Task.WhenAll on many such blocks. However, doing the same thing over a single connection - which is what multiplexing provided - is not currently possible in the driver; we experimented with this in various ways, and at least our implementation at the time had various problems and limitations. This isn't something I see us looking into in the near future as it's quite a major undertaking.

  7. reinux commented on Nov 18, 2026

    @reinux
    Author

    I guess there isn't too much harm in using multiple connections in order to minimize round trip time. Maybe that limits the maximum number of concurrent users at the service level though since the thread pool is a finite resource, so batching might be the way to go either way?

  8. modified the milestones: 11.0.0, 12.0.0 on Nov 20, 2026
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

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions