You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
google_cloud_firestore 0.5.5: ~2× higher latency under concurrent load after switch to a shared HTTP/2 connection #333
Title:google_cloud_firestore 0.5.5: ~2× higher latency under concurrent load since the switch to a shared HTTP/2 connection
Environment
google_cloud_firestore 0.5.5, pulled in through firebase_admin_sdk 0.5.3 (^0.5.0); last good version: 0.5.4
Dart 3.12.2, dart_frog 1.2.6 on Cloud Run (europe-west3)
One global Firestore instance per container; container concurrency 25
Problem
0.5.5 pools all requests over shared HTTP/2 connections instead of opening an HTTP/1.1 connection per request. After a redeploy that picked up 0.5.5, our Firestore-heavy workloads became about 2× slower. We changed no code in the affected paths.
Workload
0.5.4
0.5.5
Nightly batch job (almost no other traffic)
424–583 s
1,041–1,081 s
Nightly batch job
96–110 s
204–215 s
10–27 parallel bulk-read requests (median, only requests > 60 s)
61–75 s
83–130 s
p99 end-to-end latency of the whole service
~1 min
~2 min
Requests that do only small reads also slow down whenever bulk reads run on the same instance. That suggests contention on the shared connection.
Suspected cause
All requests share one TCP connection, the flow-control windows may be small, and package:http2 does its framing in Dart on the same isolate as the application.
Reproduction
final db =FirebaseApp.initializeApp(/* ... */).firestore();
final sw =Stopwatch()..start();
awaitFuture.wait(List.generate(20, (_) => db.collection('large_collection').get())); // 5k–20k docs eachprint('${sw.elapsedMilliseconds} ms');
Run once with 0.5.4 and once with 0.5.5 (via dependency_overrides), then compare.
Questions
Can we switch back to the HTTP/1.1 transport, or configure the pool size and flow-control window?
Should a transport change like this ship as a patch release? Everyone on ^0.5.0 picks it up automatically.
@markbreuss the two upstream PRs that fix this, dart-lang/http#1999 and dart-lang/http#2029, are now merged. We're waiting on a new release of package:http2, and once that's out we'll release new versions of google_cloud_firestore and firebase_admin_sdk with the fix.
Activity
demolaf commentedon Oct 6, 2026
Hi @markbreuss , thanks for raising this. I'll try to reproduce the latency and work on a fix.
demolaf commentedon Oct 9, 2026
@markbreuss thanks for raising this. This is currently being worked on in the upstream repo dart-lang/http#1999 and dart-lang/http#2015.
Once those are released I'll bump
http2and keep this issue updated.demolaf commentedon Oct 23, 2026
@markbreuss the two upstream PRs that fix this, dart-lang/http#1999 and dart-lang/http#2029, are now merged. We're waiting on a new release of
package:http2, and once that's out we'll release new versions ofgoogle_cloud_firestoreandfirebase_admin_sdkwith the fix.