From db402276e17e87042bf207dc97761fe791469577 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Tue, 28 Feb 2012 11:40:18 +0000 Subject: [PATCH] Added msleep() on reload to allow new processes to start. This is expected to ensure smoother operation on reload (and with less chance of listen queue overflows). Prodded by Igor Sysoev. --- src/os/unix/ngx_process_cycle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index 080d40c1e..2b6f4c72a 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -250,6 +250,10 @@ ngx_master_process_cycle(ngx_cycle_t *cycle) ngx_start_worker_processes(cycle, ccf->worker_processes, NGX_PROCESS_JUST_RESPAWN); ngx_start_cache_manager_processes(cycle, 1); + + /* allow new processes to start */ + ngx_msleep(100); + live = 1; ngx_signal_worker_processes(cycle, ngx_signal_value(NGX_SHUTDOWN_SIGNAL));