Welcome! Log In Create A New Profile

Advanced

[PATCH 4 of 4] Changed default value of sendfile_max_chunk to 2m

Maxim Dounin
October 11, 2021 03:10PM
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1633978667 -10800
# Mon Oct 11 21:57:47 2021 +0300
# Node ID a6426f166fa41d23040e5b3aefb2d6340c10a53c
# Parent c7ef6ce9455b01ee1fdcfd7288c4ac5b3ef0de41
Changed default value of sendfile_max_chunk to 2m.

The "sendfile_max_chunk" directive is important to prevent worker
monopolization by fast connections. The 2m value implies maximum 200ms
delay with 100 Mbps links, 20ms delay with 1 Gbps links, and 2ms on
10 Gbps links. It is also seems to be a good value for disks.

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3720,7 +3720,7 @@ ngx_http_core_merge_loc_conf(ngx_conf_t
ngx_conf_merge_value(conf->internal, prev->internal, 0);
ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
ngx_conf_merge_size_value(conf->sendfile_max_chunk,
- prev->sendfile_max_chunk, 0);
+ prev->sendfile_max_chunk, 2 * 1024 * 1024);
ngx_conf_merge_size_value(conf->subrequest_output_buffer_size,
prev->subrequest_output_buffer_size,
(size_t) ngx_pagesize);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 0 of 4] sendfile_max_chunk series

Maxim Dounin 358 October 11, 2021 03:10PM

[PATCH 3 of 4] Upstream: sendfile_max_chunk support

Maxim Dounin 114 October 11, 2021 03:10PM

Re: [PATCH 3 of 4] Upstream: sendfile_max_chunk support

Sergey Kandaurov 112 October 27, 2021 03:56PM

Re: [PATCH 3 of 4] Upstream: sendfile_max_chunk support

Maxim Dounin 132 October 27, 2021 04:54PM

[PATCH 4 of 4] Changed default value of sendfile_max_chunk to 2m

Maxim Dounin 167 October 11, 2021 03:10PM

Re: [PATCH 4 of 4] Changed default value of sendfile_max_chunk to 2m

Sergey Kandaurov 109 October 27, 2021 03:56PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 209
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready