Jump to content

PHP code running much slower than same code in ASP on IIS.


lvibar

Recommended Posts

I'm running into a problem converting a project from ASP to PHP.

 

While converting, I'm noticing running any of the pages is ridiculously slower than its ASP counterpart. So I decide to test out one of the simple pages of the project, which basically makes a call to the MSSQL 2000 database, returns a row, and displays it. It's really just mssql_connect --> mssql_select_db --> mssql_query --> mssql_fetch_array --> echo. Thats it.

 

When running it in ASP, it takes less than a second. When running the PHP version, with a couple of the joins removed because they weren't being used, it takes over 5 seconds to fully load.

 

I'm absolutely stumped, and Googling for answers hasn't provided much help. I know PHP is slower in IIS, but not this slow. By the way, I'm running PHP5 on IIS 6, and just in case it might be an issue, output_buffering=4096 in my php.ini.

 

Thanks for any insight you guys can provide.

That could explain it to a degree, though I'm not sure it should make a noticeable difference. ASAPI is always going to be the fastest as it is built into the server itself. ASP executes as an ASAPI filter, PHP however is considered unstable when installed as an ASAPI module because of certain extensions being non-thread-safe.

 

If you know your not going to be using these extensions you could try installing php as an ASAPI module, though my recommendation would be to er on the side of caution. FastCGI is the safe bet.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.