There are two types of processor management (PM).
The static method is very simple. You have a set number of children and php-fpm will always try to maintain that number of children. So, if you set
pm.max_children = 50, you will always have 50 children, no matter what.
This is good if you have very consistent and well measured traffic. This prevents wasting effort growing and shrinking workers (minimal impact w.r.t dynamic). It also reduces unpredictability. Save CPU
All other fields are unused if set to static.
Dynamic allows your children count to fluctuate. It's easier to understand with example as we go.
When the server boots, it starts at
pm.start_servers. We now have 25 by your example.
Let's say 20 of them are being used and another request has come through, then it's served but your child count increases by 1 as it has met the minimum spare threshold. Remember, creating process is time consuming, so you want to handle it with a process that's already active. Let's say the load increases more and now you have 49 active children. Then up to 50 are made because that's your maximum. Now let's say your load decreases and there are 14 active ones. Then it'll unload one child to reach total of 49 children as it meets your maximum spare servers. If your load goes down further to zero, you will have 35 children and you'll never be able to go below 35 (with exception of via max requests, see below). Children count are reduced so you get more usable ram back.
Dynamic is a bit of a "don't worry, I'll optimize for you within limits".
This is good if you need to keep memory low. Save RAM
Requests over max
If you have 50 active and get another request, it'll likely go in queue by the manager. Though uncertain, I think it also tends to reject if the queue length is ridiculously long. If it stays in queue for too long, the requester, like nginx, will return 504 to the end user as gateway has timed out. To avoid something like all requests being timed out due to endless congestion (ddos?), nginx typically stops passing load to a dead server for a period of time defined in nginx (completely guessing around 30 seconds) once it reached a certain number of errors from the backend.
The pm.max_requests value defines how many requests a child should handle before destroying itself for a new process to take it's place (or nothing if still within the limits of the current dynamic status as defined above). This helps fight against memory leaks (either in php-fpm child itself or your application). So, if there was a memory leak, the memory usage of the child will keep going up. Why it keeps going up even after php execution completes and all that is how php-fpm optimizes its processes and stuff... I feel like that's a separate essay.
To note for prevention of confusion indicated by your post (or lack of clarity). This has NOTHING to do with how many visitors you have or even how many people are viewing your site right now. It's all about how many php we are processing simultaneously. You'd expect most processes to complete in under 300ms. Under 100ms as ideal in personal opinion. With a better hardware, you can process more quickly, so you can handle more visitors (or more precisely, requests) despite no change in simultaneous process count.
P.S. All I said here applies to apache as well. Just different variable names.