nginx/auto
Andrew Clayton 453b5b5caf Configure: add a check for sched_getaffinity(2).
This will help to better determine the number of worker processes to
create in certain situations.

Unlike sysconf(_SC_NPROCESSORS_ONLN) this takes into account per-process
cpu allowed masks as set by sched_setaffinity(2)/cpusets etc.

So while a system may have 64 on-line cpu's, nginx itself may be limited
to using just four of them in which case we should create just four
worker processes not 64 under 'worker_processes auto;'

sched_getaffinity(2) is available on at least Linux & FreeBSD.
2025-11-28 04:51:54 +00:00
..
cc Configure: ensure we get the "built by ..." line in nginx -V. 2025-11-04 16:11:53 +00:00
lib Configure: MSVC compatibility with PCRE2 10.47. 2025-11-06 15:34:58 +04:00
os Core: added support for TCP keepalive parameters on macOS. 2025-05-27 01:59:02 +04:00
types Configure: stop polluting NGX_ namespace. 2016-06-27 15:00:06 -07:00
configure Win32: i386 now assumed when crossbuilding (ticket #2416). 2023-02-23 18:15:59 +03:00
define Copyright updated. 2012-01-18 15:07:43 +00:00
endianness Configure: fix build with -Werror=old-style-definition. 2016-06-27 15:00:05 -07:00
feature Configure: fix build with -Werror=old-style-definition. 2016-06-27 15:00:05 -07:00
have Copyright updated. 2012-01-18 15:07:43 +00:00
have_headers Copyright updated. 2012-01-18 15:07:43 +00:00
headers Copyright updated. 2012-01-18 15:07:43 +00:00
include Configure: stop polluting NGX_ namespace. 2016-06-27 15:00:06 -07:00
init Configure: marked top-level make targets as phony. 2021-02-20 12:44:26 +03:00
install Configure: fixed "make install" when cross-compiling to Windows. 2024-02-26 20:00:46 +00:00
make Configure: ordered directories. 2021-09-21 14:46:25 +03:00
module Configure: shared sources for addon modules. 2020-11-10 17:13:20 +03:00
modules SSL: object caching. 2024-10-01 17:59:24 +04:00
nohave Copyright updated. 2012-01-18 15:07:43 +00:00
options Stream: ngx_stream_pass_module. 2024-02-21 17:36:02 +04:00
sources Core: the ngx_event_udp.h header file. 2022-01-25 15:41:48 +03:00
stubs Copyright updated. 2012-01-18 15:07:43 +00:00
summary PCRE2 library support. 2021-12-25 01:07:15 +03:00
threads Configure: fixed static compilation with OpenSSL 1.1.1. 2018-03-22 15:55:57 +03:00
unix Configure: add a check for sched_getaffinity(2). 2025-11-28 04:51:54 +00:00