0

What is the recommend size of the http2 dynamic HPACK header table? Should this normally be set higher than your header size? Any recommendations regarding this?

rgullhaug
  • 1,065
  • 2
  • 10
  • 19

1 Answers1

1

As discussed elsewhere:

I'm not sure what you mean "Should this normally be set higher than your header size". The SETTINGS_HEADER_TABLE_SIZE sets a maximum table size for ALL the headers. So not really dependent on any one header.

Additionally some headers will be able to use the static table (e.g. :status: 200) and so never need to be in the dynamic table.

Other headers may change for each request (e.g. content length) so are unlikely to be stored in the dynamic table.

Larger table sizes mean more HPACK efficiency, but more memory requirements for client and server. So it's a balance. So there is no definitive answer to "how large should my HPACK table size be." It depends on how variable your headers are, how much traffic and memory.

To be honest the defaults are usually defaults for a reason so would stick with those unless you've a very good reason to change them, or deep understanding of what they mean.

Some say HPACK is a micro-optimisation anyway. Worst impact with a "too small" HPACK header is that every few requests, some full headers may need to be sent. Not so bad. Last I heard Nginx didn't even implement the dynamic table for client-side requests and it still works fine.

Make it too big however, and your web server memory increases, and the ability to service many concurrent connections suffers. Which may not be apparent until you see a spike in traffic.

So if anything avoid increasing it from the default.

Barry Pollard
  • 40,655
  • 7
  • 76
  • 92