Commit 2e768fa
perf: skip H2 for full-tunnel batch requests
Full-tunnel batches already coalesce N ops into one HTTP request,
so H2 stream multiplexing adds no benefit — there's nothing to
multiplex. Worse, H2 introduces measurable regressions:
- Long-poll batches complete at 16–17s (LONGPOLL_DEADLINE + latency)
instead of timing out at 10s on H1. Each idle poll holds an Apps
Script execution slot 60% longer, reducing available concurrency.
- NonRetryable error path (RequestSent::Maybe) silently drops
batches with no retry — data loss the H1 path doesn't have.
- POOL_MIN_H2_FALLBACK trims the H1 pool from 8 to 2 once H2
lands, starving tunnel batches that still need the H1 pool.
A/B tested on Pixel 6 Pro (30 batch samples each):
| Metric | H2 (stock v1.9.20) | H1 (this PR) | v1.9.14 |
|------------------|--------------------|--------------|---------|
| 16–17s batches | 8–10/30 | 0/30 | 0/30 |
| 10s timeouts | 0 | 4/30 | 5/30 |
| Active RTTs | 1.4–2.4s | 1.3–2.2s | 1.4–2.3s|
Changes:
- tunnel_batch_request_to: skip h2_relay_request, go straight to
H1 pool acquire(). Removes the H2 try/fallback/NonRetryable block.
- run_pool_refill: always maintain POOL_MIN (8) connections. The
H2-era POOL_MIN_H2_FALLBACK (2) trim starved tunnel batches;
with tunnel traffic on H1 the pool must stay at full capacity.
H2 multiplexing remains active for relay mode (non-full) where it
genuinely helps — each browser request is a separate HTTP call that
benefits from stream multiplexing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9611279 commit 2e768fa
1 file changed
Lines changed: 12 additions & 66 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
986 | | - | |
| 986 | + | |
987 | 987 | | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
996 | 993 | | |
997 | 994 | | |
998 | 995 | | |
999 | 996 | | |
1000 | 997 | | |
1001 | 998 | | |
1002 | 999 | | |
1003 | | - | |
1004 | 1000 | | |
1005 | 1001 | | |
1006 | 1002 | | |
| |||
1010 | 1006 | | |
1011 | 1007 | | |
1012 | 1008 | | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
| 1009 | + | |
1031 | 1010 | | |
1032 | 1011 | | |
1033 | 1012 | | |
| |||
2876 | 2855 | | |
2877 | 2856 | | |
2878 | 2857 | | |
2879 | | - | |
2880 | | - | |
2881 | | - | |
2882 | | - | |
2883 | | - | |
2884 | | - | |
2885 | | - | |
2886 | | - | |
2887 | | - | |
2888 | | - | |
2889 | | - | |
2890 | | - | |
2891 | | - | |
2892 | | - | |
2893 | | - | |
2894 | | - | |
2895 | | - | |
2896 | | - | |
2897 | | - | |
2898 | | - | |
2899 | | - | |
2900 | | - | |
2901 | | - | |
2902 | | - | |
2903 | | - | |
2904 | | - | |
2905 | | - | |
2906 | | - | |
2907 | | - | |
2908 | | - | |
2909 | | - | |
2910 | | - | |
2911 | | - | |
2912 | | - | |
2913 | | - | |
2914 | | - | |
2915 | | - | |
2916 | | - | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
2917 | 2863 | | |
2918 | 2864 | | |
2919 | 2865 | | |
| |||
0 commit comments