I'm running IIS and PHP and we're running into some bottlenecks under load testing. The pages are cached, but sometimes we can get load times up to 30 seconds for a user. This seems to happen when the cache expires. We're looking into a lot of different things to fix this issue, so one of our first places to look is at IIS and PHP. Normally I run PHP under Apache and don't really have these issues. Anyone have some good tips/best practices for running PHP under IIS? We do have FastCGI turned on already.
PHP on IIS runs fine. It's not perfect, and it's probably not "optimal", but the marriage of the two is not going to inherently cause 30 second load times.
You will be best served by inserting a timer throughout your PHP code to determine what line(s) are causing the huge delay, if it is indeed an issue on the page generation side. If it's an issue with loading embedded elements, you may be well-served analyzing it with Firebug or the Google Code analysis tools: http://code.google.com/speed/tools.html
Also, one thing to keep in mind, you said there's a lot going on "under the hood" of the app.. I'm assuming there is a database backend. With that being said, if its MySQL I have this text that I've used in the past to help diagnose slow MySQL queries which could be part of the problem. I'm assuming there are similar options with MSSQL, etc.
To enable slow query logging of mysql Enter the following lines in /etc/my.cnf and restart mysql
Enable slow query log This is a great tool for checking what queries take too long log-slow-queries=/tmp/slow_queries.log log-update = /var/lib/mysql/updates.log
MySQL has built-in functionality that allows you to log SQL queries to a file , You can enable the full SQL queries logs to a file or only slow running queries log. It is easy for us to troubleshoot/ debug the sql statement if SQL queries log enable , The slow query log is used to find queries that take a long time to execute and are therefore candidates for optimization.
To enable you just need to add some lines to your my.cnf file, and restart. Add the following:
To enable slow Query Log only log-slow-queries = /var/log/mysql/mysql-slow.log long_query_time = 1
After enabling slow query, mysqld writes a statement to the slow query log file and it consists of all SQL statements that took more than long_query_time seconds to execute. The time to acquire the initial table locks is not counted as execution time. mysqld only log after SQL statements has been executed and after all locks have been released, so log order might be different from execution order. The minimum and default values of long_query_time are 1 and 10, respectively.
To enable full Log Query log=/var/log/mysqldquery.log