We have a set up below serving around 150 concurrent users during peak hours
While Moodle is running normally most of the time, occasionally we get 500 errors from IIS. After reviewing IIS trace files, we found that most of the errors have the error code FASTCGI_RAPID_FAILURE_PROTECTION (The FastCGI process has failed frequently recently. Try the request again in a while) from FastCGI. There is nothing in PHP error logs or Windows Event logs, which suggests that perhaps php-cgi.exe process is either busy or crashed. The errors also cannot be reproduced and usually happens consecutively within 10-30 requests once.
We have tweaked the settings but there's no luck. Here are the current relevant settings.
Also this issue only started to occur after we upgraded Moodle from 3.1 to 3.5