Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

PHP-FPM workers and PHP’s memory_limit control different dimensions of capacity. A worker is a PHP-FPM child process that serves requests; pm.max_children caps how many can serve at the same time. memory_limit caps how much PHP-managed memory one script request may allocate. You can run out of workers while each request is small, or hit a request’s memory limit while other workers are idle.

Correct tuning requires both controls: size worker concurrency for available host or container memory and upstream capacity, then set a per-request limit that is high enough for the workload but low enough to contain leaks and accidental spikes.

The difference at a glance

Question PHP-FPM workers memory_limit
What is being limited? How many FPM child processes may handle requests concurrently. How much memory one PHP script may allocate through PHP’s memory manager.
Primary setting pm.max_children, together with the selected pm mode. Core PHP memory_limit; an FPM pool can enforce it with php_admin_value[memory_limit].
Scope All active children in a pool. One request or script execution.
Typical failure sign Queued requests, rising wait time, or a “max children reached” notice. “Allowed memory size exhausted” for the request that exceeded its limit.
What raising it changes Potential throughput and concurrency, along with aggregate memory pressure. The size of workload one request can complete, along with that request’s possible memory footprint.

They are therefore not interchangeable. Increasing memory_limit does not create another worker, and increasing pm.max_children does not give an individual script a larger memory allowance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a PHP-FPM worker actually is

PHP-FPM (FastCGI Process Manager) keeps a pool of child processes ready to execute PHP requests. A web server passes a request to an available child; that child runs the script, sends the response, and remains in the pool according to the pool’s process-management rules. In practical terms, one busy child normally handles one request at a time, so the number of children establishes the pool’s simultaneous service ceiling.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

The pm process-management modes

The FPM manual defines three modes:

  • static: the pool maintains a fixed number of children, equal to pm.max_children.
  • dynamic: the pool adjusts its population using pm.max_children, pm.start_servers, pm.min_spare_servers, and pm.max_spare_servers.
  • ondemand: children are created when requests arrive, up to pm.max_children, and can be removed after being idle.

The mode changes how quickly processes are created and retired; it does not remove the upper bound represented by pm.max_children.

What pm.max_children means

In static mode it is the number of children created. In dynamic and ondemand modes it is the maximum number that may exist. The PHP documentation describes this as the limit on the number of simultaneous requests that will be served. When every child is busy, additional requests wait in the web-server or FastCGI queue, or are rejected by an upstream timeout or connection limit. A different PHP memory setting cannot make those waiting requests run sooner.

A worker is more than a memory number

Each child has baseline process overhead, loaded extensions, allocator state, and application data. Its operating-system resident size can vary over time and between requests. A worker may also retain memory after a request until it is recycled. Consequently, counting workers is a concurrency decision first and a memory decision second, even though the two are tightly related operationally.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What PHP memory_limit controls

The core PHP configuration defines memory_limit as the maximum amount of memory, in bytes, that a script is allowed to allocate. The current PHP manual documents a default of 128M (manual accessed in 2026); that is a documentation default, not a production recommendation. Setting the directive to -1 removes PHP’s own limit, which transfers responsibility entirely to the operating system, container, or hosting platform.

Per-request scope

The limit applies to the script execution context handling a request. If one import, image operation, report, or framework bootstrap needs more than the effective value, that request can fail even when other FPM children are idle and the machine appears to have free RAM. Raising the limit helps only requests whose peak PHP-managed allocation is above the old ceiling; it does not reduce queueing.

PHP-managed memory is not total process memory

The memory_get_usage documentation warns that the value is memory reserved by PHP’s memory manager, not all memory the operating system has given to the PHP process, which is typically larger. Native extensions, shared libraries, allocator arenas, opcache, JIT, database clients, and other services can consume memory outside the amount charged to the PHP memory manager. Host and container metrics are therefore required for capacity planning.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

How the two settings interact

Worker count multiplies the memory pressure created by individual requests. For an illustrative burst, suppose pm.max_children permits 20 concurrent children and active requests commonly use 100 MB of PHP-managed memory each. The PHP-managed portion could approach 2,000 MB (about 2 GB) while all 20 are busy. That is a planning inference, not a guaranteed allocation: requests differ, workers have baseline overhead, extensions may allocate outside PHP’s tracker, and the operating system and other services need headroom.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why increasing workers can trigger an outage

If a pool is raised from 10 to 20 children, it can accept twice as many simultaneous requests, but it also permits twice as many processes to consume memory at once. The new concurrency may improve throughput when the old limit caused queueing and enough RAM is available. It can instead cause swapping, container OOM kills, or host instability when the workload was already memory-bound.

Why increasing memory_limit can also be risky

A higher per-request ceiling allows a single request to grow larger. During a burst, several requests can each approach that ceiling. Removing the limit with -1 may let a leak or unexpectedly large input consume all available memory before the operating system intervenes. Treat the value as a guardrail, not as a substitute for fixing inefficient queries, unbounded collections, or leaks.

Diagnose the symptom before changing a value

Observed symptom Most likely control First checks
“Max children reached,” FastCGI queue growth, or rising request wait time Worker/concurrency capacity Pool status, pm.max_children, selected pm mode, web-server connection and upstream timeouts.
“Allowed memory size exhausted” naming a PHP allocation Per-request memory ceiling or request allocation pattern Effective memory_limit, peak PHP usage, input size, query result size, recursion, and leaks.
Container or host OOM kill with no PHP memory-limit error Aggregate process or non-PHP memory Container and host memory graphs, worker resident memory, opcache/JIT, extensions, and other services.
Slow responses after a traffic increase, but no errors Could be queueing, CPU saturation, or downstream limits Separate time waiting for a worker from time executing; inspect CPU, database, web-server queues, and FPM metrics.

Do not raise both settings in response to one symptom. Changing one control at a time makes the resulting latency, error rate, PHP usage, and host memory easier to interpret.

How to choose a safe worker limit

1. Establish the memory budget

Start with memory actually available to the PHP pool, not the headline RAM installed in the machine. Reserve capacity for the operating system, web server, database, caches, opcache, monitoring, deployment tools, and normal bursts. In a container, use the container limit rather than the host total. A pool that consumes the entire nominal budget leaves no room for these components or for allocator variation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Measure representative workers

Observe several normal and worst-case requests. Compare PHP-level measurements such as memory_get_usage with process or container resident memory. Record separate values for idle workers, ordinary traffic, large imports, report generation, and scheduled jobs. PHP-managed usage alone will understate total process cost, while a single peak request may overstate what every child needs.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

3. Calculate a conservative ceiling

A useful planning expression is:

worker ceiling ≈ memory reserved for PHP pool ÷ measured per-worker memory budget

Use a per-worker budget that includes baseline resident memory and a realistic request peak, then round down and retain headroom. For example, if 3 GB is deliberately reserved for PHP and measurements justify a 150 MB budget per child, the arithmetic ceiling is 20 children. That number is illustrative; your measurements, traffic pattern, CPU capacity, and upstream limits determine the production value.

4. Check non-memory bottlenecks

More workers cannot overcome a saturated CPU, a database connection pool that is smaller than the request concurrency, a web server’s FastCGI connection cap, or an upstream rate limit. If requests are CPU-bound, adding children may increase contention and reduce response time. Match the FPM ceiling to the slowest dependency as well as to RAM.

5. Select the process mode deliberately

  • Static gives predictable process count and memory reservation, useful when traffic is steady and the budget is known.
  • Dynamic keeps a warm baseline and adjusts spare capacity, balancing latency and memory for variable traffic.
  • Ondemand minimizes idle workers during quiet periods, but process creation can add latency when traffic returns and bursts can allocate many children quickly.

Whichever mode you choose, monitor whether children are being recycled, whether the queue forms, and whether the configured maximum is reached.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to set and verify memory_limit

Find the effective value first

Check the value in the same execution context that fails. A command-line PHP binary may load a different configuration from the FPM service, and a pool can override the global setting. Use the PHP information output or a diagnostic endpoint protected from public access to inspect memory_limit; verify after reloading FPM and test through the web path that serves the affected request.

Choose a limit from measured peaks

Measure successful requests and failed requests, identify the operation that creates the peak, and set a limit above the legitimate peak with a defined margin. Keep the margin finite. If a request needs an unexpectedly large value, first examine pagination, streaming, image dimensions, query columns, batch size, and retained references. A higher ceiling should be a considered exception, not an automatic response to every error.

Understand configuration locations

The directive can be set in PHP’s core configuration, in an FPM pool, or in application-level configuration where permitted. Pool administrators can enforce a value with:

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
php_admin_value[memory_limit] = 256M

The FPM manual states that settings supplied with php_admin_value cannot be overridden by ini_set(). This is appropriate when an administrator needs a hard policy. A regular php_value[memory_limit] or an application call to ini_set() may have different precedence depending on the deployment, so always verify the effective runtime value rather than assuming the file you edited won.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Be cautious with -1

An unlimited PHP setting can be useful for a controlled diagnostic run, but it removes the per-script safety boundary. Do not use it as a general production fix unless an external cgroup or process policy is deliberately providing an equivalent limit and the workload has been assessed.

Configuration examples and safe rollout

Changing worker capacity

In the relevant FPM pool configuration, set the process mode and limits together. A conceptual dynamic-pool fragment looks like this:

pm = dynamic
pm.max_children = 20
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 8

The numbers are examples, not universal recommendations. Ensure the mode-specific directives are valid for your PHP version and distribution, validate the configuration, reload FPM gracefully, and watch the pool and host while traffic returns.

Changing a pool memory policy

php_admin_value[memory_limit] = 256M

Apply a pool-level policy when different applications need different ceilings or when application code must not raise the limit. Confirm that the request is handled by that pool; editing a CLI configuration does not change an FPM pool.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Change one variable at a time

  1. Capture a baseline: throughput, latency, queue or max-children events, PHP memory usage, process resident memory, CPU, and OOM events.
  2. Change either pm.max_children or memory_limit, not both.
  3. Validate configuration and reload the appropriate FPM service without dropping existing requests where your deployment supports a graceful reload.
  4. Exercise normal traffic and the largest legitimate workload.
  5. Keep the change only if the target symptom improves without exhausting memory or creating a new upstream bottleneck.
  6. Record the effective value and rollback procedure.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common questions

“Are PHP workers the same as the memory limit?”

No. Workers are concurrent FPM processes; memory_limit is a per-script PHP allocation ceiling. They interact through aggregate resource use but represent different limits.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

“Why do I get an allowed-memory error when the server has free RAM?”

The request may have exceeded its configured PHP-managed ceiling. The operating system can still show unused RAM because PHP intentionally stopped the script at its limit. Also check that you are viewing the FPM process’s effective configuration, not a different CLI or pool setting.

“Does increasing pm.max_children increase PHP memory?”

It does not change the limit for any one request. It raises the number of requests that may run simultaneously, so total potential memory consumption rises when additional children become active.

“Can I solve queueing by raising memory_limit?”

No. Queueing points to available workers or an upstream ceiling. Investigate pm.max_children, process mode, web-server and FastCGI queues, CPU, and downstream services.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

“Can I solve memory errors by adding workers?”

No. A request that exceeds memory_limit will fail regardless of idle workers. Profile the request and adjust its legitimate limit or its allocation pattern.

Monitoring that keeps both limits honest

Track metrics at three levels:

  • FPM pool: active and idle processes, maximum-children events, queue or listen backlog, request duration, and process recycling.
  • PHP runtime: effective memory_limit, peak memory_get_usage, allocation failures, and the operation associated with each peak.
  • System or container: resident memory, working-set and cgroup usage, swap, CPU, OOM-kill events, opcache/JIT, and memory used by databases and other services.

Correlating timestamps matters. A memory spike with all workers active suggests an aggregate concurrency problem; a single request failing at the same allocation threshold suggests the per-script limit. Keep alerts for both conditions so one does not mask the other.

A practical decision framework

  1. Identify the failure boundary. Queueing and “max children” are concurrency signals; “allowed memory size exhausted” is a request allocation signal; OOM kills are aggregate signals.
  2. Verify the effective configuration. Inspect the FPM pool serving the request and distinguish it from CLI settings. Check whether php_admin_value makes the policy non-overridable.
  3. Measure before sizing. Use both PHP memory metrics and process/container memory, across ordinary and worst-case requests.
  4. Apply the smallest targeted change. Raise worker capacity only when there is memory and dependency headroom; raise a request limit only when the workload is legitimate and understood.
  5. Retest under concurrency. A setting that works for one request may fail when many workers run at once.
  6. Keep operational headroom. Leave capacity for the operating system, extensions, other services, traffic bursts, and measurement error.

The durable distinction is simple: pm.max_children answers “How many requests may this pool serve at once?” while memory_limit answers “How much PHP-managed memory may this one script allocate?” Treating them as separate controls, then sizing their combined effect, prevents both needless queueing and avoidable out-of-memory failures.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.