]> git.kaiwu.me - nginx.git/commitdiff
Added msleep() on reload to allow new processes to start.
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 28 Feb 2012 11:40:18 +0000 (11:40 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 28 Feb 2012 11:40:18 +0000 (11:40 +0000)
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

index 080d40c1e6ca1e02235ac8a8755a9a01a7dd5584..2b6f4c72a4cf85d679e818d72bf95c5a85ded18c 100644 (file)
@@ -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));