Welcome! Log In Create A New Profile

Advanced

[nginx] Events: added configuration check on the number of connections.

Maxim Dounin
July 12, 2018 01:58PM
details: http://hg.nginx.org/nginx/rev/8f152ca81f5f
branches:
changeset: 7316:8f152ca81f5f
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Jul 12 19:50:07 2018 +0300
description:
Events: added configuration check on the number of connections.

There should be at least one worker connection for each listening socket,
plus an additional connection for channel between worker and master,
or starting worker processes will fail.

diffstat:

src/event/ngx_event.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)

diffs (25 lines):

diff --git a/src/event/ngx_event.c b/src/event/ngx_event.c
--- a/src/event/ngx_event.c
+++ b/src/event/ngx_event.c
@@ -421,6 +421,21 @@ ngx_event_init_conf(ngx_cycle_t *cycle,
return NGX_CONF_ERROR;
}

+ if (cycle->connection_n < cycle->listening.nelts + 1) {
+
+ /*
+ * there should be at least one connection for each listening
+ * socket, plus an additional connection for channel
+ */
+
+ ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
+ "%ui worker_connections are not enough "
+ "for %ui listening sockets",
+ cycle->connection_n, cycle->listening.nelts);
+
+ return NGX_CONF_ERROR;
+ }
+
#if (NGX_HAVE_REUSEPORT)

ls = cycle->listening.elts;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Events: added configuration check on the number of connections.

Maxim Dounin 370 July 12, 2018 01:58PM



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

Online Users

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