title: IIS 10 / SQL Server 2017 / very slow connections with classic ASP
body: <p>I've been running classic ASP / SQL Server 2008 R2 / Windows Server 2012 R2 / IIS 8 for about 10-15 years; no problem. But I'm trying to get these same scripts to run on a new machine with Windows Server 2016 (IIS 10) and SQL Server 2017, and am having problems with connections to the databases. (And rewriting them in ASP.NET isn't an option for right now).</p>
  
  <p>For example, I'll create a connection to the database:</p>
  
  <pre><code>set conn = server.CreateObject("ADODB.Connection")  
  conn.ConnectionTimeout=120  
  conn.Open("Provider=sqloledb;Data Source=(local);Initial Catalog=myDatabase;Integrated Security=SSPI")
  </code></pre>
  
  <p>First problem, it takes two seconds (exactly two seconds, for every connection) to create the connection. And even though the connection is supposed to stay open, subsequent connections (same db; same connection string) on that page or another page take exactly two seconds (even though I've set the ConnectionTimeout to 120 seconds).</p>
  
  <p>Second problem (more serious), it then takes two seconds (almost exactly two seconds) to do any operation on that connection, even if it's just one row, e.g.:</p>
  
  <pre><code>sql = "update myTable set zipCode = 91839 where ID = 12345"  
  conn.execute(sql)
  </code></pre>
  
  <p>And then if I do another update (for example) on just one row, it takes another two seconds (almost exactly two seconds):</p>
  
  <pre><code>sql = "update myTable set zipCode = 02930 where ID = 67890"  
  conn.execute(sql)
  </code></pre>
  
  <p>With the previous setup (SQL Server 2008 R2 / Windows Server 2012 R2 / IIS 8), it took a couple of milliseconds to create a connection, and then simple updates like those above would take 1-2 ms. But now every connection and every operation on that connection takes two seconds + the amount of time that it should take (e.g. 2 ms).</p>
  
  <p>I'm guessing that somehow the default settings for SQL Server connections in IIS 10 have changed and that's what's causing the problem, but I'm not sure. BTW, I'm using the default IUSR account in IIS to connect to SQL Server (both in the old setup and now).</p>