title: Classic ASP pages using COM object are extremely slow
body: <p>First of all, I'd like to say upfront that some of the details on this question may be a little vague as it relates to commercial code that I obviously cannot divulge here. But anyway, here goes.</p>
  
  <p>I am currently dealing with a .Net based web application that also has pages of classic ASP in certain areas - this application has a backend MSSQL database. The data access for the classic ASP areas of the application are handled by a 32 bit DLL added into Component Services on the IIS server. The application has recently been changed so all components (IIS authentication, .Net Application Pool and a data access DLL added to Component Services) now run under a single Windows account.</p>
  
  <p>The problem I have found recently is that whilst .Net data access to the database is running at a perfectly normal speed, the classic ASP data access that goes via the COM+ component is extremely slow. Unfortunately, this doesn't seem to be throwing any errors anywhere, not in IIS logs and not in Event Viewer.</p>
  
  <p>The COM+ component is instantiated in a standard fashion and this is done in an include file that is referenced on any ASP page needing data access, eg. </p>
  
  <pre><code>var objDataProvider = Server.CreateObject("DataAccess.DataProvider");
  </code></pre>
  
  <p>The ASP pages then use methods in the COM+ to execute queries such as;</p>
  
  <pre><code>objDataProvider.Query(...)
  objDataProvider.Exec(...)
  </code></pre>
  
  <p>I have enabled failed request tracing in IIS for any ASP pages that are taking longer than 20s to process and can see that the majority of the calls are dealing with record sets as seen in the examples below.</p>
  
  <pre><code>if(rsri.EOF)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>theReturn = rsData(0);
  </code></pre>
  
  <p>The two examples above both take over 9s to run.  Profiling the SQL that runs in the background shows this runs in a matter of milliseconds which suggests the problem lies with the COM+ returning the data back to the ASP OR the ASP being slow to process it.</p>
  
  <ul>
  <li>Windows Server 2008 R2 SP1 (64 bit)</li>
  <li>Intel Xeon CPU</li>
  <li>2GB RAM</li>
  </ul>
  
  <p>Has anyone experienced a similar situation to this before or able to point me in the direction of any further diagnostics that might help?</p>