Skip to content

Commit

Permalink
Bump buffer size for HTTP response headers (#378)
Browse files Browse the repository at this point in the history
To accommodate 4 memory pages, e.g. 16k on most platforms.
  • Loading branch information
kleisauke committed Jun 30, 2023
1 parent adc6b9a commit ca63088
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/nginx/module.cpp
Expand Up @@ -443,8 +443,11 @@ void *ngx_weserv_create_loc_conf(ngx_conf_t *cf) {

// The hardcoded values
lc->upstream_conf.buffering = 1;
lc->upstream_conf.buffer_size = ngx_pagesize;
lc->upstream_conf.busy_buffers_size = 2 * ngx_pagesize;
lc->upstream_conf.buffer_size =
4 * ngx_pagesize; // 4 memory pages should be enough for most response
// headers
lc->upstream_conf.busy_buffers_size =
6 * ngx_pagesize; // Essentially, buffer_size + 2 memory pages
lc->upstream_conf.bufs.num = 256;
lc->upstream_conf.bufs.size = ngx_pagesize;
lc->upstream_conf.max_temp_file_size = 0;
Expand Down

0 comments on commit ca63088

Please sign in to comment.