1

I am running IIS 10 on Windows Server 2016. I am using PHP 8.1.4 NTS with FastCGI. PHP is optimized following the usual recommendations.

I noticed that the server's response times start to increase after about 2 hours. For example, the TTFB is roughly 150-200ms after IIS/worker processes are started. Sites load very quickly. Then, after about 2 hours or so, performance starts to decline where TTFB increases upward and eventually plateaus at around 500ms. Sometimes, it will even go as high as 800ms.

If I have the IIS application pool recycle, we're back to ~200ms where it will stay in that area for another 2 hours.

I'm trying to keep our server response times fast, and am curious what could be causing the performance to degrade after a few hours. Should we setup to recycle the pool more often? That can work, but it seems like something else is going on, and you shouldn't have to do that.

The server does not have high CPU, disk, or RAM usage. The w3wp and php-cgi processes have very little memory usage (10-20MB each). CPU is almost always under 10%, and RAM is only 50% in use.

  • Optimized IIS FastCGI parameters, and application pool parameters, to recommended settings (10k requests, etc.)

  • Reviewed MySQL 8.0 Server logs to find slow queries, but nothing with low performance was found.

ChrisB3127
  • 31
  • 3
  • Perhaps move to a Linux server, if at all possible? Windows server 2016 became [end of life on Jan 11, 2022](https://learn.microsoft.com/en-us/lifecycle/products/windows-server-2016). That should tell you something. – KIKO Software Mar 22 '22 at 20:32
  • Is it just PHP 8.1.4? – Dharman Mar 22 '22 at 21:06
  • 1
    Are those workers actually serving requests, or just sitting idle? Windows is pretty aggressive about paging memory out to disk if it's not being touched. – Sammitch Mar 22 '22 at 21:15
  • @ChrisB3127 Is your server still running fast at 1h 45m? How slow does it get if you do NOT recycle pool for 4 hours? How much A) RAM B) cores C) SWAP SPACE and D) any SSD or NVME data storage?' – Wilson Hauck Mar 22 '22 at 21:52
  • 1
    @WilsonHauck, performance is good at ~200ms, then at around 2 hours it begins to decrease to ~350ms, 400. It seems to stay at around 400-600ms after 4+ hours if you don't recycle the pool. Current config is 32GB RAM, 16 cores, 1G page file, no SSD unfortunately. – ChrisB3127 Mar 22 '22 at 23:48
  • 1
    @Sammitch, actively serving requests. I noticed this happens to all app pools, even those that get infrequent traffic. – ChrisB3127 Mar 22 '22 at 23:49
  • 1
    @KIKOSoftware, have to stick to Windows here.. I am planning an upgrade to '22 soon. – ChrisB3127 Mar 22 '22 at 23:49
  • 1
    How many processes running when TTFB increase to 500? If after two hours without any request to php, after some interval (5mins, 10mins or longer), is TTFB still 500 or even more? – Bruce Zhang Mar 23 '22 at 02:41
  • Additional information request, please. After next restart, at 2h uptime and again at 3h uptime, please for our workload analysis - comparison. Delay W22 until 3 mos past release, to avoid bug reporting. Post on pastebin.com and share links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; G) SHOW ENGINE INNODB STATUS; H) SELECT name, count FROM information_schema.innodb_metrics ORDER BY name; for server workload tuning analysis to provide suggestions. – Wilson Hauck Mar 23 '22 at 10:57
  • I upgraded to Windows 2022 over the weekend. Same problem persists, so I did some digging in PHP again. It turns out Opcache is what is causing the issue. For some reason, it begins reporting out of memory errors. I will post a new question since now the problem has been isolated to opcache. – ChrisB3127 Mar 29 '22 at 18:50

0 Answers0