I have three web server using nginx as frontend and php-cgi as backend.
We use DNS round robin to distribute load. In this server we have several PHP applications, each application is stored in its own folder.
We have a large amount of potential users (employee headcount about 20000).
Each application is being maintained by different team and consequently may be using different PHP frameworks. When one of the application has a badly written page, php-cgi instances could became stuck. When enough person accessed the 'bad' page, the entire three servers could became stuck.
Is there a mechanism to determine which PHP application has bad page problem ?
If I could determine which php page is being run by a php-cgi process, I could determine which app the page belongs to, and I could deactivate the problematic app instead of watching the entire system going down.
The problem is I haven't find out how to monitor which page is being run (and still stuck). If there is only one app and I could change it, I would insert log statements upon the start and end of the front controller. Having more than 6 apps make this method not practical anymore.