Welcome! Log In Create A New Profile

Advanced

Re: a problem in CPU affinity

Maxim Dounin
September 18, 2012 04:08AM
Hello!

On Mon, Sep 17, 2012 at 03:11:33PM +0800, chen cw wrote:

> Hi,
>
> When a worker is down, the master will spawn a new one. However, in case
> that we enable CPU affinity, the newly created workers will be bound to the
> same CPU, as the CPU which was bound to by the latest worker spawn at the
> startup or during the reload. This problem still exists in the latest
> version 1.3.6.

Yes, thank you for report. Quick and dirty fix would be:

--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -371,6 +371,8 @@ ngx_start_worker_processes(ngx_cycle_t *

ngx_pass_open_channel(cycle, &ch);
}
+
+ cpu_affinity = 0;
}


With this patch workers respawn after crashes won't have cpu
affinity set, which is probably better. It's still not ideal, but
after all real problem is a worker crash, respawn is just an
emergency mechanism.

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

a problem in CPU affinity

chen cw 1094 September 17, 2012 03:12AM

Re: a problem in CPU affinity

Maxim Dounin 448 September 18, 2012 04:08AM

Re: a problem in CPU affinity

chen cw 624 September 18, 2012 09:58PM



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

Online Users

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