Skip to content

Commit

Permalink
h2o: Reduce the size of the default HTTP2 buffer
Browse files Browse the repository at this point in the history
The initial value takes 80kB of memory for each HTTP/2 connection
which is a lot on small devices. Using 8kB instead saves a fair
amount of memory without sacrificing performance.

Signed-off-by: Remi Gacogne <[email protected]>
  • Loading branch information
rgacogne authored and neheb committed Jun 22, 2023
1 parent 1246b81 commit b53a838
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libs/h2o/patches/800-smaller-write-buffer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/include/h2o/http2_internal.h
+++ b/include/h2o/http2_internal.h
@@ -33,7 +33,7 @@
typedef struct st_h2o_http2_conn_t h2o_http2_conn_t;
typedef struct st_h2o_http2_stream_t h2o_http2_stream_t;

-#define H2O_HTTP2_DEFAULT_OUTBUF_SIZE 81920 /* the target size of each write call; connection flow control window + alpha */
+#define H2O_HTTP2_DEFAULT_OUTBUF_SIZE 8192 /* the target size of each write call; connection flow control window + alpha */
#define H2O_HTTP2_DEFAULT_OUTBUF_SOFT_MAX_SIZE 524288 /* 512KB; stops reading if size exceeds this value */

/* hpack */

0 comments on commit b53a838

Please sign in to comment.