The Four Moments When HTTP Header Size Decides Performance — MSS Split, Early Rejection, Proxy Path, Compression Table
Published 2026-12-04 · Updated 2026-12-04 · Last Verified 2026-12-04
Answer
Header size affects performance at four moments: (1) the request exceeds the MSS of about 1,460 bytes and splits across packets, (2) the front end rejects a large upload after reading only the first packets, (3) a proxy finishes reading the headers and starts streaming to the backend, and (4) the HTTP/2 or HTTP/3 header compression table (4KB by default) is evicted. Measure the header bytes and count before acting.
Applicability of This Document
| Product | HTTP/1.1, HTTP/2, HTTP/3 and the TCP transport layer (client, CDN/WAF, API Gateway, backend server) |
|---|---|
| Verified Versions | Specification values and public implementation defaults of HTTP/1.1 (RFC 9112), HTTP/2 (RFC 9113, HPACK in RFC 7541), HTTP/3 (RFC 9114, QPACK in RFC 9204) and TCP (RFC 9293), confirmed 2026-12-04 |
| Environment | Multi-tier client, CDN/WAF, API Gateway, and backend deployments. Behaviour differs between HTTP/2 and HTTP/3, which keep the TCP connection alive, and deployments where a reverse proxy buffers the body |
| Required Permissions | Read only (HTTP access, reading proxy configuration, checking MTU/MSS). The 8MB upload check is run in a verification environment |
| Execution Impact | The diagnostic commands are read only. The upload check puts traffic on the target server and the transfer may be cut mid-flight |
| Restart | None (no configuration change). If proxy settings are changed, the reload or restart procedure must be confirmed separately |
| Last Verified | 2026-12-04 |
Ready-to-Run Commands
- 対象
- Target API endpoint
- 権限
- Read-only (HTTP access)
- 変更作業
- None (read-only)
- Production実行
- Allowed (read-only)
# 対象: 対象 API エンドポイント
# 権限: 参照のみ(HTTP アクセス)
# 変更作業: なし(参照のみ)
# Production 実行: 可能(参照のみ)
# size_request is the total byte count of the request that was sent (request line, headers, body)
# time_starttransfer is the TTFB (time until the first byte comes back)
curl -sS -o /dev/null \
-w 'http=%{http_version} request_bytes=%{size_request} ttfb=%{time_starttransfer} connect=%{time_connect}\n' \
https://api.example.com/v1/ordersIf request_bytes is well above 1,460 bytes, the request is split at the MSS boundary. This is the raw header size the client sends, so it is not the same as the size the server receives: a proxy that adds or rewrites headers makes the server side larger.
- 対象
- Target API endpoint
- 権限
- Read-only (HTTP access)
- 変更作業
- None (read-only)
- Production実行
- Allowed (read-only)
# 対象: 対象 API エンドポイント
# 権限: 参照のみ(HTTP アクセス)
# 変更作業: なし(参照のみ)
# Production 実行: 可能(参照のみ)
# Estimate the total byte count of the request line and headers from the ">" lines of curl -v
curl -sS -v -o /dev/null https://api.example.com/v1/orders 2>&1 \
| awk '/^> /{n+=length($0)+2} END{printf "request_header_bytes=%d\n", n}'Header size and header count are different axes. Even a small total can mean many headers, and every extra header adds another iteration to the proxy header parsing loop. Record both the total and the count.
- 対象
- Path to the target API server
- 権限
- Read only (route lookup and ICMP probes)
- 変更作業
- None (read-only)
- Production実行
- Allowed (read-only)
# 対象: 対象 API サーバーまでの経路
# 権限: 参照のみ(経路情報の参照と ICMP 送信)
# 変更作業: なし(参照のみ)
# Production 実行: 可能(参照のみ)
# Estimate the MSS from the mtu (IPv4 MTU 1500 - IP 20 - TCP 20 = 1460)
ip route get 203.0.113.10
# Check whether a 1472-byte ICMP payload passes without fragmentation (path MTU 1500)
ping -c 3 -M do -s 1472 203.0.113.10MSS is decided per path, so confirm it rather than assuming the commonly quoted number. Tunnels and IPv6 paths commonly yield less than 1,460 bytes. The ping do-not-fragment flag needs privileges in some environments; in that case judge from the reported MTU alone.
- 対象
- Reverse proxy (Nginx)
- 権限
- Read only (reading the configuration files)
- 変更作業
- None (read-only)
- Production実行
- Allowed (read-only)
# 対象: リバースプロキシ(Nginx)
# 権限: 参照のみ(設定ファイルの読み取り)
# 変更作業: なし(参照のみ)
# Production 実行: 可能(参照のみ)
# client_header_buffer_size and large_client_header_buffers bound the header length,
# proxy_request_buffering decides how the body is read, and the number of WAF rules drives front-end processing time
nginx -T 2>/dev/null | grep -nE 'client_header_buffer_size|large_client_header_buffers|proxy_buffering|proxy_request_buffering|http2_max_header_size'Check not only the values but also that they are actually in effect: worker count, reload history, and include files that were never pulled in. As the number of matching rules grows, the per-header matching cost grows with it.
- 対象
- Target API server
- 権限
- Read only (HTTP access and the TLS handshake)
- 変更作業
- None (read-only)
- Production実行
- Allowed (read-only)
# 対象: 対象 API サーバー
# 権限: 参照のみ(HTTP アクセス・TLS ハンドシェイク)
# 変更作業: なし(参照のみ)
# Production 実行: 可能(参照のみ)
# The negotiated HTTP version
curl -sS -o /dev/null -w 'http=%{http_version}\n' https://api.example.com/v1/orders
# Check whether h2 is selected through ALPN
openssl s_client -connect api.example.com:443 -servername api.example.com -alpn h2 </dev/null 2>/dev/null \
| grep -i 'ALPN protocol'
# HPACK dynamic table setting (4096 bytes by default). Requires the nghttp client from nghttp2
nghttp -nv https://api.example.com/v1/orders 2>/dev/null | grep -iE 'HEADER_TABLE_SIZE'The nghttp output format differs between versions; if the HEADER_TABLE_SIZE field cannot be picked out, check the output sample for that version. The default table size is 4,096 bytes.
- 対象
- Verification environment API endpoint (expected to answer 401 for an expired token)
- 権限
- Read only (HTTP transmission; no server state is changed)
- 変更作業
- None (no server state is changed)
- Production実行
- Run in a verification environment (a large body against production creates traffic and load)
# 対象: 検証環境の API エンドポイント(期限切れトークンで 401 を返す想定)
# 権限: 参照のみ(HTTP 送信。サーバ状態は変更しない)
# 変更作業: なし(サーバ状態は変更しない)
# Production 実行: 検証環境で実行(本番で大きなボディを流すとトラフィックと負荷が出る)
# If the server decides from the first packets, the response returns without waiting for the body transfer
head -c 8388608 /dev/zero | tr '\0' 'a' > /tmp/upload-8m.txt
curl -sS -o /dev/null \
-w 'http=%{http_code} ttfb=%{time_starttransfer} total=%{time_total} uploaded=%{size_upload}\n' \
-H 'Authorization: Bearer <EXPIRED_TOKEN>' \
-H 'Content-Type: application/octet-stream' \
--data-binary @/tmp/upload-8m.txt \
https://api.example.com/v1/uploadIf ttfb is much smaller than total, the server decided without receiving the whole body. That is a fact about the server side only; it is not proof that the client stopped sending at the same moment, and uploaded may still be large.
How to Read the Results
| Column | Meaning | What to Check |
|---|---|---|
| size_request | Total bytes of the request that was sent (request line, headers, and body) | Well above 1,460 bytes means the request is split at the MSS boundary; 2 to 4KB needs 2 to 3 packets |
| time_starttransfer | TTFB: the time until the first byte comes back | Includes proxy-side header parsing and routing time; separate it from backend processing time |
| http_version | The negotiated HTTP version | With h2 or h3 the header compression table (4KB by default) applies; with h1 every header is sent as is |
| HEADER_TABLE_SIZE | The HPACK dynamic table size in HTTP/2 (4,096 bytes by default) | Check whether the per-request varying headers fill the table |
When to Use This
- API responses are slow but the database query execution time does not explain it
- Latency is high only for a particular client or a particular gateway path
- Only requests from clients that send large headers are slow
- A large upload is answered with 401 mid-transfer, yet no full request appears in the server log
- Several APIs sharing the same TCP connection all slow down at the same time
- Only the proxy TTFB is long while backend processing time is short
Possible Causes (Most Likely First)
01
The request is split across packets because it exceeds the MSS of about 1,460 bytes
A single TCP segment normally carries about 1,460 bytes of data. When the headers are 1KB or less, the request line, headers, and a short body fit in one packet, so the server starts processing the moment the first packet arrives. At 2 to 4KB of headers the request is split across 2 to 3 packets and the server must hold an incomplete header set while waiting for reassembly. If a packet is lost and retransmitted, even a 10-byte body can incur tens to hundreds of milliseconds of latency.
02
The front end rejects a large upload early
A payload of tens of megabytes arrives as thousands of packets. A reverse proxy (Nginx, ALB) or a WAS finishes parsing as soon as the first one or two packets (the header portion) arrive, without waiting for the whole body. If the Authorization token has expired or Content-Length exceeds the limit at that point, it stops reading the remaining thousands of body packets and either closes the TCP connection (RST) or answers 401. Had the credential been at the very end of the body, the server would have had to receive tens of megabytes of unnecessary data and write it to disk or memory before it could learn that the request was not permitted.
03
Routing work in the reverse proxy or API Gateway becomes the front-end latency
The real topology is client, then CDN/WAF, then API Gateway, then the backend server. The front gateway does not buffer until the whole body arrives: it reads the headers, immediately picks the destination backend, opens the socket, and starts streaming. When the headers are bulky or numerous, the gateway header parsing loop and routing rules (regular expression matching, WAF ruleset matching) multiply the work, and the TTFB before the body relay starts grows directly.
04
The HTTP/2 and HTTP/3 header compression table of 4KB by default is evicted
HTTP/2 (HPACK) and HTTP/3 (QPACK) keep frequently used headers in a 4KB memory table (the dynamic table) for the life of the connection and send them compressed as index numbers of 1 to 2 bytes. The moment a bulky custom header that changes on every request, or a multi-KB authentication token, arrives, the existing cache in that 4KB table is evicted and discarded. From that point on, even ordinary requests lose their header compression ratio and are sent literally, so the transmission efficiency of every API sharing that TCP connection drops at the same time.
Diagnostic Steps
- 1
Step 1: Measure the total request bytes and the TTFB
Read-onlyCapture size_request and time_starttransfer together to decide whether the delay is time spent sending or time spent waiting for the first response. A large send time leads to step 2; a large TTFB leads to step 4.
- 2
Step 2: Measure the header-only byte total and the header count
Read-onlyEstablish the total size of the request line plus headers, and how many headers there are. A total above the MSS means splitting is happening. Many small headers point at the proxy parsing loop instead.
- 3
Step 3: Confirm the MSS on the path
Read-onlyEstimate the MSS from the MTU reported by ip route get and from a path MTU check. If it is below the 1,460 bytes you assumed, splitting starts earlier than expected.
- 4
Step 4: Check the proxy header handling and the size of its rule set
Read-onlyCheck the header length limits, the reverse proxy buffering settings, and the number of WAF and routing rules. The rule count and its matching cost act directly on the front-end TTFB.
- 5
Step 5: Check the HTTP version and the state of the compression table
Read-onlyCheck the negotiated HTTP version (h1, h2, h3) and the HPACK or QPACK dynamic table settings. Confirm whether headers that change on every request fill the table.
- 6
Step 6: Verify early rejection of a large upload in a verification environment
LowAgainst a verification environment, send an 8MB body with an expired token and confirm that the response arrives before the body transfer finishes. Be careful with traffic when doing this against production.
Solutions
Low-risk action that can be done immediately
Use the measured header values to decide what to remove
LowMeasure the total bytes and the count, then establish whether one large header or fifty small headers is doing the damage. Work on the larger effect first.
Move large per-request values out of the headers
LowA value that changes on every request, or a multi-KB token in a header, evicts the HTTP/2 and HTTP/3 compression table and costs compression ratio even to other requests on the same connection. Move the value into the body or another path, or design so the connection is not reused.
Keep credentials in the headers so large uploads can be rejected early
LowWith the credential in the headers, the server can answer 401 without receiving the whole body. When the deciding information sits at the end of the body, large volumes of receiving and writing happen before the rejection.
Change requiring advance review
Review the proxy header length limits and buffering settings
MediumCheck that limits such as large_client_header_buffers are not tighter than the actual header set requires. Settings that are too loose instead let slow clients hold connection slots and memory, so state the reasoning behind the values. Reducing the number of WAF and routing rules, and reordering the matching, cuts front-end TTFB.
Match the HTTP/2 and HTTP/3 compression table settings to the real header set
Expert Review RequiredCheck SETTINGS_HEADER_TABLE_SIZE against the real header composition and bring the design inside the table. Changing the value affects a whole connection, so establish the scope first: the set of APIs sharing that connection.
Work requiring expert review
Treat the header volume as a design envelope
Expert Review RequiredDefine the total header bytes per request as a budget, and route back to design when it is exceeded. TCP and proxy values differ per environment, so define it so that it can be refreshed from measurements rather than from a fixed number.
!Warnings
- MSS is decided per path. The widely quoted 1,460 bytes assumes an Ethernet MTU of 1500, so always confirm the MTU and path MTU of your own environment. Tunnels and IPv6 commonly give values below 1,460 bytes.
- Fitting in one packet is about the headers plus the body, not the headers alone. A zero-byte body still splits the request if the request line and headers add up past the boundary.
- Early rejection is a fact about the server responding sooner; it is not evidence that the client stopped sending at the same moment. uploaded may still be large.
- The HTTP/2 and HTTP/3 header compression table is per connection. When one request evicts the table, every API sharing that connection loses efficiency at the same time.
- A rejection at the proxy also consumes that connection processing slot while the rejection response is produced. Concentrating a burst of requests saturates the front end rather than the destination.
- Keeping a rotated authentication token in the headers on every request wastes traffic that can be neither tracked nor cached. Confirm the reduction in monitoring after a rotation.
Differences by Version and Environment
If This Doesn't Resolve It
When you cannot tell which layer rejected the request
Separate a rejection by the proxy (WAF or gateway) from a rejection by the backend. Match the proxy access log against the backend application log by request ID and confirm where the status code came from. Getting this backwards means optimising the wrong header.
When you cannot tell whether header count or total size matters
If the total is small but there are many headers, the bottleneck is the number of proxy parsing iterations, and the WAF matching count with it. If there are few headers but a large total, MSS splitting and table capacity are the main causes. Both must be measured to tell them apart.
When you cannot identify a connection-wide slowdown
A connection-wide slowdown appears across the whole set of APIs sharing that connection at the same time. In a test environment, deliberately reuse one connection, send a single request with a large header, and compare how the response times of the other requests change.
Basis and Limitations of This Document
General technical explanation
The explanation is based on the public specifications for HTTP/1.1, HTTP/2, HTTP/3, and TCP (RFC 9112, 9113, 9114, and 9293, plus HPACK RFC 7541 and QPACK RFC 9204) and on general operational knowledge. The specifications were checked on 2026-12-04. No measurements from a specific product or customer environment are included.
FAQ
Do large headers always make things slow?
Not always. While the total header size fits in one packet, the server can start processing on the first packet. It matters only when one of the four moments applies: packet splitting, early rejection, proxy routing work, or compression table eviction. Measure first to establish which one applies.
Where does the 4KB figure come from?
It is the default size of the header compression dynamic table held by HPACK in HTTP/2 and QPACK in HTTP/3, defined as 4,096 bytes in their specifications. It is not an internal setting of ours. If the server overrides it via SETTINGS, follow the measured value.
Is a fast 401 on a large upload a good thing?
The server deciding sooner is good: it means less traffic and less load than receiving the whole body and then rejecting it. It does not mean the client stopped sending at the same time. How quickly the rejection lands depends on the server-side policy and the nature of the path.
What is the difference between MSS and MTU?
The MTU is the largest IP packet that can be carried, while the MSS is the largest payload that fits in one TCP segment. Subtracting 20 bytes of IP header and 20 bytes of TCP header from an Ethernet MTU of 1500 gives the 1,460-byte MSS figure. It varies by path, so confirm it in your own environment.
How should headers be reduced?
Measure the total bytes and the count first and see which one is doing the damage. If the total is large, take out the items that are genuinely large (big tokens, values that change per request) and consider not reusing the connection or compressing the values instead. If the count is the problem, start by removing duplicate headers and cutting the rule set on the proxy side.
Official Documentation & References
HTTP/2 frame specification and SETTINGS, including the header compression table size
The HTTP/3 specification and stream multiplexing over QUIC
Dynamic table entry format and the eviction rules
The QPACK dynamic table and compression scheme
Transmission behaviour including MSS and retransmission
Header types and design notes for request and response headers
Questions This Document Covers
- When headers are large, which stage actually slows down?
- How do I measure TTFB to tell a proxy problem from a backend problem?
- Why does HTTP/2 header compression stop being applied?
What the Risk Labels Mean
- Read-onlyDoes not change data or settings.
- LowImpact is limited, but permissions and load should be checked.
- MediumMay affect performance, locking, or cost.
- HighMay cause an outage, data loss, or require recovery work.
- Expert Review RequiredRequires a separate review before applying to production.
GIIP's Scope of Support
GIIP supports the breakdown of TTFB across the client, CDN/WAF, gateway, and backend layers; the measurement of headers and the design review of header composition; the isolation of how WAF and routing rule matching cost lands on front-end latency; and the connection-wide effects in HTTP/2 and HTTP/3. Specification values and measurements from your own environment are reported separately, and ranges that could not be confirmed are handed over as unconfirmed.
Author & Technical Review
GIIP Production Operations Team
About 30 years of experience in designing, migrating, and operating large-scale web services, SQL Server, Oracle, AWS, and Azure. Experience includes 12 sets of x12large-class AWS RDS for SQL Server environments, an Oracle environment with roughly 120,000 tables, and migrating roughly 3TB from TiDB to Aurora MySQL. AI agents and human experts currently continue to monitor and operate multiple cloud databases and about 30 web services.
What to Configure When Monitoring Servers and Databases 24/7
A checklist, organized by layer, of what to monitor, how to think about thresholds, the escalation structure, and why synthetic monitoring is necessary when designing 24/7 monitoring.
infrastructureRandom IOPS vs. Sequential IOPS, and How to Read Benchmark Results
A document organizing why an IOPS figure cannot be compared without I/O size, queue depth, and read/write ratio, and how to build measurement conditions with fio.
sql-serverWhy TLS 1.2 Connections Fail with SQLNCLI10, and Migrating to MSOLEDBSQL 19
This separates connection failures caused by SQLNCLI10's lack of TLS 1.2 support from those caused by MSOLEDBSQL 19's default changing to Encrypt=yes, and organizes what to check during migration.
incident-responseWhat database incidents AI agents can handle, and what humans must decide
We split incident response into phases to separate what AI can own (detection, triage, limited initial response) from what requires human judgment (irreversible actions, shutdown decisions), and provide read-only triage queries.
Related Services
Discuss how to separate HTTP header size from TTFB
If you need to repeat the same checks across multiple environments, we can discuss your entire operations setup.
Discuss how to separate HTTP header size from TTFB