Opened 3 years ago

Closed 3 years ago

Last modified 8 months ago

#997 closed defect (wontfix)

$body_bytes_sent compute bigger in HTTP2.0 then HTTP1.X

Reported by: cjhust1986@… Owned by:
Priority: critical Milestone:
Component: nginx-core Version: 1.9.x
Keywords: $body_bytes_sent, HTTP2.0 Cc:
uname -a: 2.6.32-573.22.1.el6.x86_64
nginx -V: nginx-1.9.15

Description

source file:2000Byte;
HTTP1.0/HTTP1.1: $body_bytes_sent = 2000byte, I think it's correct
HTTP2.0: $body_bytes_sent = 2300byte(uncertainty) > 2000byte, I think it's wrong

I know the fream in HTTP2.0 causes this problem, the frame include NGX_HTTP_V2_FRAME_HEADER_SIZE, HTTP header...

I think this method is wrong, $body_bytes_sent is not $bytes_sent.

look forward to your reply

Change History (2)

comment:1 Changed 3 years ago by vbart

  • Resolution set to wontfix
  • Status changed from new to closed

A quote from the documentation:

$body_bytes_sent - number of bytes sent to a client, not counting the response header

In other words: $body_bytes_sent = $bytes_sent - response_header_size, where the response_header_size value in case of HTTP/2 is the size of the response HEADERS block, not the data frame headers.

That's it.

Of course it's bigger, since HTTP/2 framing adds additional overhead (like chunked transfer encoding in HTTP/1.1).

comment:2 Changed 8 months ago by mdounin

See also #1596.

Note: See TracTickets for help on using tickets.