[PATCH 09/11] Router: removed unused structure member proxy_buffers.

Andrew Clayton andrew at digital-domain.net
Thu Jun 16 01:00:59 UTC 2022


proxy_buffers is declared as a structure member of nxt_socket_conf_t and
is set in nxt_router_conf_create(), however it is not used anywhere.

Removing it has the nice side effect of making the nxt_socket_conf_t
structure require one less cacheline (on x86-64 at least) as the summary
from pahole[0] shows

Before

    /* size: 200, cachelines: 4, members: 25 */
    /* sum members: 185, holes: 3, sum holes: 15 */

After

    /* size: 192, cachelines: 3, members: 24 */
    /* sum members: 177, holes: 3, sum holes: 15 */

[0]: https://github.com/acmel/dwarves
---
 src/nxt_router.c | 1 -
 src/nxt_router.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/src/nxt_router.c b/src/nxt_router.c
index 6b69b2c..b0f2ff1 100644
--- a/src/nxt_router.c
+++ b/src/nxt_router.c
@@ -1840,7 +1840,6 @@ nxt_router_conf_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf,
             skcf->max_body_size = 8 * 1024 * 1024;
             skcf->proxy_header_buffer_size = 64 * 1024;
             skcf->proxy_buffer_size = 4096;
-            skcf->proxy_buffers = 256;
             skcf->idle_timeout = 180 * 1000;
             skcf->header_read_timeout = 30 * 1000;
             skcf->body_read_timeout = 30 * 1000;
diff --git a/src/nxt_router.h b/src/nxt_router.h
index 7e337d2..538e54e 100644
--- a/src/nxt_router.h
+++ b/src/nxt_router.h
@@ -181,7 +181,6 @@ typedef struct {
     size_t                 max_body_size;
     size_t                 proxy_header_buffer_size;
     size_t                 proxy_buffer_size;
-    size_t                 proxy_buffers;
 
     nxt_msec_t             idle_timeout;
     nxt_msec_t             header_read_timeout;
-- 
2.36.1



More information about the unit mailing list