title: SQL Server 2008 slow down after 30,000 user Insert from a busy Java web application
body: <p>One of our system finally launch in production and during the peak hour (about 200 concurrent user at any one time), traffic can ramp up to 30,000 user transaction within an hour. </p>
  
  <p>What we notice is a strange behavior that right after our SQL server restarted, the performance is very fast. Even with 200 concurrent user at the beginning, the transaction to SQL server 2008 R2 is less than 10ms. However, after about 15,000 transactions, we can see each transaction can take up 100ms to complete. When comes to about 30,000 transactions, each transaction may take up 300ms the worst case. If we dont restart the SQL server, even single thread, the transaction will still be around 300ms. </p>
  
  <p>Each transaction will perform the following:</p>
  
  <ul>
  <li>1 Select in Master table and and 2 select in account table, 1 insert or update into master table, 1 insert or update to account table, and 1 or 2 insert into history table </li>
  <li>account table (2 column as primary key, 4 column as index and another 6 column as data column)</li>
  <li>master table (3 column as primary key, 5 column as index and another 11 column as data column)</li>
  <li>history table (3 column as primary key, 4 column as index and another 15 column as data column)</li>
  </ul>
  
  <p>Note: Some data column above is index above is because we used in the where clause. </p>
  
  <p>Note: During Select, we does not join any table for performance purposes. </p>
  
  <p>Note: DB Server and Web Server is actually the same server.</p>
  
  <p><strong>System setup:</strong></p>
  
  <ul>
  <li>OS: Windows 2008 Enterprise</li>
  <li>Web Server: Tomcat Web Server</li>
  <li>Connection to DB: Spring Connection Pooling (Min 50, Max 350)</li>
  <li>Using the Latest SQL JDBC Driver</li>
  <li>DB Server: Sql Server 2008 R2 SP1</li>
  </ul>
  
  <p><strong>Server Hardware:</strong> </p>
  
  <ul>
  <li>CPU: 4 x Quad Core CPU (each core have 2 threads) that means total of 32 physical threads</li>
  <li>Memory: 16GB</li>
  <li>Harddisk: raid 1 on 4 x SAS 15K Harddisk. this means 2 harddisk visible for OS. Application data and OS use 1 harddisk while SQL DB use another harddisk.</li>
  </ul>
  
  <p>Any idea where we can track and resolve the performance slow down after 10,000 transactions?</p>