0

We have a fairly weak server - 2 cores of Xeon Gold 6132.

Until recently the server didn't have much traffic but now we added a web page that generates more traffic than usual.

This is the number of PHP FastCGI instances I see in Task Manager:

php_much

I am using the non-thread-safe version of PHP (8.2).

Now the server is really slowing down. Is there a way to adjust the way IIS and PHP work so that it will work better? Perhaps only allow up to 2 FastCGI instances to work simultaneously? Will that even make it work better? I was thinking that what's causing the extreme slowdown is the fact that currently IIS allows way more FastCGI instances than the number of cores. (There is sufficient RAM)

I'm just not sure what are the optimal settings for the FastCGI in IIS (10) for this setup, or maybe in general - how many max instances per core, how many number of requests per instance etc.

Edit: Here is an image of the FastCGI settings: enter image description here

7
  • 1
    Provide your FastCGi settings. Have you considered using the thread-safe version of PHP which would efficiently spin up multiple instances. You probably should think about upgrading the server specifications to better match the current load
    – Ramhound
    Commented Jun 16 at 9:11
  • Thank you, I used the non-thread-safe version because I read that Microsoft recommends using it with IIS and FastCGI. Should I still try the thread-safe version? Also I updated the post and added an image of the FastCGI settings - note that the value of Instance MaxRequests is 10000 but I tried several other values with no change in performance - 200, 400, 1000, 5000
    – Stackerito
    Commented Jun 16 at 13:30
  • 1
    You sure those are the actual settings? Your screenshot clearly show there are more than 4 instances
    – Ramhound
    Commented Jun 16 at 14:10
  • 1
    MaxInstances is defined as “Specifies the maximum number of FastCGI worker processes that can be started in an application pool. Acceptable values are in the range from 0 through 10000.” where the default value is 0.
    – Ramhound
    Commented Jun 16 at 15:49
  • 1
    You just don’t have enough resources to serve that traffic. One usually has more processes/threads than cores simply because most common workloads imply waiting (for a remote database server or for disks) and that’s where the bottleneck is, but here the bottleneck is on the CPU. If you reduce the number of processes you just switch from sharing the cores in parallel to sharing them in series, basically (unless you have issues with RAM and swapping due to a very large number of processes).
    – jcaron
    Commented Jun 16 at 16:16

0

You must log in to answer this question.

Browse other questions tagged .