Worker cpu affinity for 8 cores/cpus

Igor Sysoev is at rambler-co.ru
Fri Sep 5 12:02:53 MSD 2008


On Fri, Sep 05, 2008 at 12:35:31AM -0700, mike wrote:

> ouch. so the logfile showing the SCHED_AFFINITY binding or whatever at
> startup isn't actually happening?
> 
> when did it break? i swear i was able to see each worker properly
> bound to one core when i examined it in the past.

The problem that nginx says that it pass 32-bytes CPU mask to a kernel,
while actually it passes 4 valid bytes only. It depends on kernel
how it will treat this mask: if it has 2 or 4 CPUs it may work correctly.

Besides, there are several Linux kernel and glibc sched_setaffinity()
interfaces, so you may have a case that works.

> On Fri, Sep 5, 2008 at 12:28 AM, Igor Sysoev <is at rambler-co.ru> wrote:
> > On Fri, Sep 05, 2008 at 12:14:04AM -0700, mike wrote:
> >
> >> On Thu, Sep 4, 2008 at 11:58 PM, Igor Sysoev <is at rambler-co.ru> wrote:
> >>
> >> > However, please note that worker_cpu_affinity is currently broken and
> >> > it may not work correctly. Recently CPU affinity had appeared in
> >> > FreeBSD 7, so I will probably fix it to see how it may affect on perfomance.
> >>
> >> does it work in linux?
> >
> > worker_cpu_affinity had been written for Linux only and currently
> > it's broken on Linux.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list