comparison src/event/ngx_event.c @ 7316:8f152ca81f5f

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 12 Jul 2018 19:50:07 +0300
parents e7b2b907c0f8
children 9d2ad2fb4423
comparison
equal deleted inserted replaced
7315:e7b2b907c0f8 7316:8f152ca81f5f
419 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, 419 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
420 "no \"events\" section in configuration"); 420 "no \"events\" section in configuration");
421 return NGX_CONF_ERROR; 421 return NGX_CONF_ERROR;
422 } 422 }
423 423
424 if (cycle->connection_n < cycle->listening.nelts + 1) {
425
426 /*
427 * there should be at least one connection for each listening
428 * socket, plus an additional connection for channel
429 */
430
431 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
432 "%ui worker_connections are not enough "
433 "for %ui listening sockets",
434 cycle->connection_n, cycle->listening.nelts);
435
436 return NGX_CONF_ERROR;
437 }
438
424 #if (NGX_HAVE_REUSEPORT) 439 #if (NGX_HAVE_REUSEPORT)
425 440
426 ls = cycle->listening.elts; 441 ls = cycle->listening.elts;
427 for (i = 0; i < cycle->listening.nelts; i++) { 442 for (i = 0; i < cycle->listening.nelts; i++) {
428 443