Welcome! Log In Create A New Profile

Advanced

[PATCH] Avoid multiple bind for the same address during config test

Anonymous User
April 12, 2019 09:38AM
# HG changeset patch
# User Andrey Kolyshkin <a.kolyshkin@corp.vk.com>
# Date 1555075759 -10800
# Fri Apr 12 16:29:19 2019 +0300
# Node ID 549f07c848d82ef152ed54f31b25dcfe89452a66
# Parent 5155d0296a5ef9841f035920527ffdb771076b44
Avoid multiple bind for the same address during config test

If reuseport is specified in the config, then during config test nginx makes multiple calls to the bind function for the same address.
It causes a problem when large number of connections goes to the server and bind (inet_csk_bind_conflict) loads cpu multiple times.
After fixing, bind is called only 1 time per address while testing of the config.

diff -r 5155d0296a5e -r 549f07c848d8 src/core/ngx_connection.c
--- a/src/core/ngx_connection.c Tue Apr 09 16:00:30 2019 +0300
+++ b/src/core/ngx_connection.c Fri Apr 12 16:29:19 2019 +0300
@@ -104,7 +104,7 @@
ngx_core_conf_t *ccf;
ngx_listening_t ols;

- if (!ls->reuseport || ls->worker != 0) {
+ if (!ls->reuseport || ls->worker != 0 || ngx_test_config) {
return NGX_OK;
}

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

[PATCH] Avoid multiple bind for the same address during config test

Anonymous User 344 April 12, 2019 09:38AM

Re: [PATCH] Avoid multiple bind for the same address during config test

Maxim Dounin 231 April 12, 2019 12:10PM



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

Online Users

Guests: 116
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