Recommended Free Tools
Start with worker_processes auto;. NGINX will try to detect the CPU capacity visible to its process and create an appropriate number of request-processing workers. Check the CPUs available inside the same virtual machine or container that runs NGINX, not just the host’s total. Use an explicit number only when load measurements, CPU pinning, or an orchestration constraint show that it is better.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Worker count is only one part of capacity planning. worker_connections, the process open-file limit, TLS or proxy workload, disk speed, and CPU quotas can all become the real bottleneck. The settings below give you a safe baseline and a way to tune it without guessing.
As an Amazon Associate I earn from qualifying purchases.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallThe short answer
For a current NGINX installation on a multi-core system, put this at the top level of nginx.conf:
worker_processes auto;
events {
worker_connections 512;
}
auto is a starting point, not a promise of maximum throughput. It asks NGINX to use the CPU capacity it can see. A container limited to two CPUs may therefore need only two workers even when the physical host has 32. Conversely, an explicit value equal to the host’s CPU count can create unnecessary scheduling overhead when a VM, cpuset, or cgroup gives NGINX less capacity.
#1 Best Overall
- The world’s fastest gaming processor, built on AMD ‘Zen5’ technology and Next Gen 3D V-Cache.
- 8 cores and 16 threads, delivering +~16% IPC uplift and great power efficiency
- 96MB L3 cache with better thermal performance vs. previous gen and allowing higher clock speeds, up to 5.2GHz
- Drop-in ready for proven Socket AM5 infrastructure
- Cooler not included
After changing the configuration, reload NGINX, verify the resulting worker count, and test with representative traffic. Keep the automatic setting unless measurements demonstrate a repeatable benefit from another number.
How NGINX uses CPU cores
NGINX has a master process and one or more worker processes. The master reads and validates configuration, opens listening sockets, and starts or stops workers. Workers accept connections and process HTTP requests, TLS handshakes, static files, and proxy traffic. The worker_processes directive controls how many workers the master starts.
The documented default is 1. That is safe for a small installation but leaves additional cores unused for request processing. NGINX documentation says the optimal value depends on several factors, including CPU cores, the number of hard drives storing data, and the load pattern. A static-file server, a TLS-heavy reverse proxy, and a disk-bound application can therefore reach different optimums on the same machine.
On multiprocessor systems, NGINX’s HTTPS guidance recommends running several workers, at least as many as the available CPU cores, and shows worker_processes auto; in a multi-core example. Treat that as a starting point: benchmark your own traffic before forcing a fixed count.
How to find the CPU count NGINX can actually use
The relevant number is the CPU capacity visible to the NGINX process. A physical server’s specification, a cloud provider’s advertised vCPU total, and the process’s effective CPU set are not necessarily the same.
Rank #2
- Can deliver fast 100 plus FPS performance in the world's most popular games, discrete graphics card required
- 6 Cores and 12 processing threads, bundled with the AMD Wraith Stealth cooler
- 4.2 GHz Max Boost, unlocked for overclocking, 19 MB cache, DDR4-3200 support
- For the advanced Socket AM4 platform
Linux host or virtual machine
Run these commands in the same operating-system environment as NGINX:
nproc
getconf _NPROCESSORS_ONLN
Both report online processors available to the command. You can inspect the broader kernel view with:
grep -c '^processor' /proc/cpuinfo
That last value can differ from the CPUs a service is allowed to run on when affinity or cgroup limits are present. Prefer the process-visible result when deciding on workers.
Docker or another container
Execute the check inside the running container rather than on the Docker host:
docker exec <container-name> nproc
docker exec <container-name> getconf _NPROCESSORS_ONLN
A container may have a CPU quota, a cpuset, or both. A host command such as nproc can consequently report a larger number than the NGINX process can schedule on. If the container was started with a CPU limit, confirm the limit in the container or through the orchestrator’s workload definition before selecting an explicit worker count.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
- AMD Ryzen 9 9950X3D Gaming and Content Creation Processor
- Max. Boost Clock : Up to 5.7 GHz; Base Clock: 4.3 GHz
- Form Factor: Desktops , Boxed Processor
- Architecture: Zen 5; Former Codename: Granite Ridge AM5
VMs, cpusets, and orchestrators
A virtual machine normally exposes only its assigned vCPUs. Kubernetes and other schedulers can additionally restrict a pod to a cpuset or a quota. Check the effective CPU assignment for the NGINX process, not merely the node’s total. If the scheduler can change that assignment during deployment, auto is usually safer than baking a host-specific integer into the image.
Other operating systems
On macOS, sysctl -n hw.logicalcpu displays online logical CPUs. On Windows, Task Manager’s CPU panel shows logical processors; PowerShell can report them with:
(Get-CimInstance Win32_Processor).NumberOfLogicalProcessors
NGINX deployments are most commonly Linux or BSD based, so always confirm the number from the Unix environment where the master process runs.
Configure and reload worker_processes
The directive belongs in the main context of nginx.conf, outside the http and events blocks. Its syntax is either an integer or auto. The automatic form is supported in NGINX versions 1.3.8 and 1.2.5 and later.
- Open the active configuration. Use the file loaded by your service, commonly
/etc/nginx/nginx.conf, and confirm the path with your package or service configuration. - Set the worker count. Use
worker_processes auto;unless you have a measured reason to choose an integer. - Keep connection settings separate. In the
eventsblock, set an appropriateworker_connectionsvalue; changing worker count does not automatically raise file-descriptor limits. - Validate before applying. Run
nginx -t. Do not reload if the test reports a syntax or permission error. - Reload gracefully. On a systemd installation, use
sudo systemctl reload nginx; with a direct installation,sudo nginx -s reloadsends the reload signal to the master process. - Confirm the result. List NGINX processes with your operating system’s process tool and check that the master has the expected number of workers. Then observe traffic rather than assuming the setting helped.
An explicit value is valid when the deployment requires it. For example, a service pinned to four CPUs might use worker_processes 4;. Do not set the number to the physical host’s core total when NGINX is confined to a smaller CPU set.
Rank #4
- Pure gaming performance with smooth 100+ FPS in the world's most popular games
- 6 Cores and 12 processing threads, based on AMD "Zen 5" architecture
- 5.4 GHz Max Boost, unlocked for overclocking, 38 MB cache, DDR5-5600 support
- For the state-of-the-art Socket AM5 platform, can support PCIe 5.0 on select motherboards
- Cooler not included
auto versus an explicit worker count
| Decision factor | worker_processes auto; |
Explicit integer |
|---|---|---|
| CPU capacity visible to NGINX | Attempts to adapt to the CPUs available to the process. | You must keep the number aligned with VM, container, and cpuset changes. |
| Static, TLS, proxy, or disk-heavy load | Provides a sensible baseline, but workload testing is still required. | Useful when measurements show a stable optimum for a known workload. |
| Connection and file-descriptor limits | Does not change worker_connections or open-file limits. |
Also does not change those limits; more workers alone may add no usable capacity. |
| CPU utilization and latency | Start here, then compare utilization, latency, throughput, and errors under representative load. | Keep it only when a repeatable test improves the metrics that matter. |
| VM or container quotas | Usually follows the capacity visible to the process. | Can oversubscribe CPUs if copied from the host or a different environment. |
| Operational constraints | Adapts when assigned CPU capacity changes. | May be required by a platform, licensing policy, or deliberate CPU partitioning. |
More workers are not automatically better. Excess workers compete for the same CPUs, consume memory, and can increase context switching. Too few workers can leave cores idle when request processing is CPU-bound. The correct choice is the one that improves your measured service metrics at the concurrency and request mix you actually serve.
How many worker_connections do you need?
worker_connections is the maximum number of simultaneous connections opened by one worker. Its documented default is 512. The limit includes connections to proxied upstream servers, not just client sockets, and it cannot exceed the process’s open-file limit.
A rough upper bound is:
worker_processes × worker_connections
For example, four workers with worker_connections 512; give a nominal 2,048 connections. That is not a guaranteed number of clients. A reverse-proxy request can consume one connection for the client and another for the upstream, keepalive sockets remain open, and the operating system may impose a lower descriptor limit. Memory, bandwidth, upstream capacity, and application latency can become bottlenecks first.
Free tools Windows power users keep installed
One-click scans. No signup required.
Tune the two limits independently
- Raise
worker_connectionswhen the measured concurrency of client and upstream sockets approaches the per-worker ceiling. - Raise the NGINX process’s open-file limit as well; a larger directive is ineffective if the operating system refuses more descriptors.
- Check whether proxying doubles connection usage for your workload.
- Test long-lived WebSocket, HTTP/2, or keepalive traffic separately from short static requests because each pattern holds connections for a different length of time.
Do not multiply workers merely to obtain a larger theoretical connection total. First establish whether the bottleneck is CPU, descriptors, memory, network, or the upstream application.
A measurement-led tuning procedure
- Record the starting point. Note the CPU count visible inside the NGINX environment, current worker count,
worker_connections, open-file limits, request rate, latency percentiles, and error rate. - Use the automatic baseline. Set
worker_processes auto;, validate withnginx -t, reload, and confirm the workers started. - Apply representative load. Include the real mix of static files, TLS handshakes, dynamic proxy requests, uploads, and long-lived connections. A synthetic test containing only one request type can favor the wrong setting.
- Watch CPU and latency together. Look for saturated CPUs, idle CPUs, rising tail latency, throughput changes, and worker or upstream errors. A higher request rate is not an improvement if latency or errors worsen.
- Check descriptor headroom. Compare active connections and open files with both
worker_connectionsand the process limit. If descriptors are exhausted, fix that constraint rather than adding workers. - Test one explicit value at a time. If
autois suboptimal, test a small range around the visible CPU count while holding other settings constant. Keep a change only when the result is repeatable. - Re-test after deployment changes. A new container quota, VM size, TLS configuration, storage layout, or traffic mix can invalidate a previously optimal integer.
CPU affinity: when to bind workers
By default, NGINX workers are not bound to particular CPUs. The worker_cpu_affinity directive can bind workers to CPU sets represented by bitmasks. Its auto affinity mode is documented for FreeBSD and Linux.
Best Value
- Processor provides dependable and fast execution of tasks with maximum efficiency.Graphics Frequency : 2200 MHZ.Number of CPU Cores : 8. Maximum Operating Temperature (Tjmax) : 89°C.
- Ryzen 7 product line processor for better usability and increased efficiency
- 5 nm process technology for reliable performance with maximum productivity
- Octa-core (8 Core) processor core allows multitasking with great reliability and fast processing speed
- 8 MB L2 plus 96 MB L3 cache memory provides excellent hit rate in short access time enabling improved system performance
Affinity is an advanced placement tool, not a substitute for sizing workers. Deliberate binding can reduce unwanted migration or reserve CPUs for other services, but it can also conflict with a container’s cpuset or an orchestrator’s scheduling decisions. Use it only when you control the CPU topology and measurements show a benefit. If the platform changes the available CPU set, revisit the masks before reusing the configuration.
Troubleshooting common symptoms
Only one worker appears
Check whether the configuration still uses the default or an explicit worker_processes 1;. Run nginx -T to display the complete active configuration, then validate and reload. A process listing taken before the reload can also show the old generation of workers.
auto selects fewer workers than the host has CPUs
This is expected when NGINX runs in a VM, container, cpuset, or cgroup quota. Measure CPUs from inside that environment and inspect the scheduler’s assignment. The host total is not the effective capacity of the process.
Adding workers does not increase throughput
Check CPU utilization, disk wait, upstream response time, network bandwidth, memory pressure, and open-file limits. If another resource is saturated, additional workers only compete for the same bottleneck.
Connections are rejected despite a high connection setting
Compare active client and upstream sockets with the per-worker limit and the process open-file limit. Remember that proxied connections count too. Raise both limits only after confirming that the operating system, memory budget, and upstream service can handle the additional concurrency.
Latency rises after enabling affinity
Remove or relax the affinity rule and repeat the same load test. A mask that conflicts with a container or leaves some workers sharing too few CPUs can be worse than the default scheduler behavior.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Quick Recap
Practical checklist
- Count CPUs from the same VM or container that runs NGINX.
- Use
worker_processes auto;as the initial setting. - Keep
worker_connectionsand open-file limits as separate tuning tasks. - Validate with
nginx -tbefore every reload. - Measure CPU, latency, throughput, errors, descriptors, and upstream health under realistic traffic.
- Choose an explicit worker count only for a demonstrated performance gain or a clear deployment constraint.
- Apply CPU affinity only when intentional placement is needed and compatible with the platform’s CPU assignment.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




