0

I am hosting, on Windows Server 2022, a web application that makes regular ajax calls to a PHP backend.

The calls themselves are quite light, just pulling and pushing data from and to a MySQL db.

Over 1,000 users could be logged in concurrently (up to 10,000 in the near future). It doesn't seem to be an issue, until 100+ or so users log in concurrently, or near-concurrently.

I then get the server clogged with tens of stuck PHP-CGI processes.

Can anyone share advice on an adequate FastCGI config for this scenario? I am - to say the least - confused by

Maxrequests vs Maxinstances Activity timeout vs Idle timeout Queue length Rapid fails per minute vs Request timeout Using tcp vs using Namedpipe

Thanks

resle
  • 189
  • 1
  • 1
  • 9
  • Login counts are not of interest. Queries per second is. "nginx" is touted as fast; I have not tested it. You need to discover the max number of we clients and connections to MySQL. The latter is `SHOW GLOBAL STATUS LIKE 'Max_used_connections'` and also `'Threads_running'`. Do you have SSD? – Rick James Nov 17 '22 at 00:34
  • Learn how to analyze why PHP web apps clogged with a profiler and then you can resolve stuck PHP-CGI processes and get what you wanted. Otherwise, you just get more of them. – Lex Li Nov 17 '22 at 01:28
  • @RickJames it's a VPS, and yes I believe it's running on SSD. I remember in the past, analysis of that same application led to set max_connections to 600. However, SQL didn't seem to be the bottleneck. I was able to fire queries on workbench and get results instantly - while the clogging went on. It looks to me that PHP was somehow the culprit – resle Nov 17 '22 at 04:02
  • @LexLi can you suggest a profiler that will work with IIS? All I have found seems to require either Nginx or Apache – resle Nov 17 '22 at 04:06
  • @resle - PHP is limited to, or allowed to, a number of processes as specified by the web server. Otherwise, my experience says that PHP is not the villain. Sure, 600 MySQL connections is no problem -- but only if most are sitting idle. When `Threads_running` exceeds 20, you have a problem. – Rick James Nov 17 '22 at 15:54
  • @resle - And... AJAX feels lightweight, but look at what it must go through -- client -> web server -> fire up PHP -> connect to database -> perform query -> unwind. Realize that PHP is a process that is not sitting there waiting, but must be started up like any other process. – Rick James Nov 17 '22 at 15:59

0 Answers0