Book Image

Nginx Essentials

By : Valery Kholodkov, Valery I Kholodkov
Book Image

Nginx Essentials

By: Valery Kholodkov, Valery I Kholodkov

Overview of this book

Table of Contents (13 chapters)

Worker processes allocation on multi-core systems


If your Nginx workload is CPU-bound, such as when using response compression on proxied content, on systems with multiple processors or multiple processor cores, it might be possible to obtain additional performance by associating each worker process with its own processor/core.

In a multi-core processor, each core has its own instance of Translation Lookaside Buffer (TLB) that is used by the memory-management unit to accelerate virtual address translation. In a preemptive multitasking operating system, each process has its own virtual memory context. When an operating system assigns an active process to a processor core and the virtual memory context does not match the context that filled the TLB of that processor core, the operating system has to flush the TLB as its content is no longer valid.

The new active process then receives a performance penalty, because it has to fill the TLB with new entries as it reads or writes memory locations...