[Patch] SO_REUSEPORT support from master process

Valentin V. Bartenev vbart at nginx.com
Fri Sep 19 16:48:16 UTC 2014

On Friday 19 September 2014 15:52:35 Lu, Yingqi wrote:
> Hi Valentin,
> Thanks very much for your email.
> Regarding to your first question, I did following test:
> 1. Start Nginx
> 2. Offline half of the CPU threads by "echo 0 > /sys/devices/system/cpu/"cpu#"/online
> 3. Reload Nginx and check the worker process, the number of listen sockets is actually
> reduced to half.
> 4. Then, I put back the offlined CPU threads back online, and reload the Nginx again.
> 5. The new worker process now has 2X listen sockets as the CPU threads doubled since the
> previous reload.
> Every time Nginx reloads, my understanding is it will run Ngx_init_cycle. CPU_num_check is  > there. Is above testing the correct way to check if reload works? Please let me know if I > missed anything.

What happens if you shutdown half of your cpus again, and try to reload nginx under
high load?

As I understand right, with your patch it will close half of listen sockets, and all
the connections that have been waiting to be accepted on these sockets will be lost.

  wbr, Valentin V. Bartenev

More information about the nginx-devel mailing list