title: Slow MySQL performance on new Windows 2012 R2 Server
body: <p>I'm experiencing a very puzzling difference in MySQL performance with a new machine I've recently built compared to two older machines. The machines use MySQL as a backend for an IIS-based webserver.</p>
  
  <p>All three use the same MySQL options (same ini file).
  All are running the same tables...all MyISAM. 
  Caching is off on all.</p>
  
  <p>The newest server (#3) generates web pages noticeably slower than the others and I've narrowed the problem to MySQL. The newest server (#3), equals or dramatically surpasses the other machines in pretty much every benchmark I've run.</p>
  
  <p>It is ONLY mysql that seems to be slow.</p>
  
  <p>At first I suspected some specific queries or configuration might be the problem but even the simplest queries are slower. I've kept making the queries simpler and simpler and the difference remained. No matter what query I run, simple or complex, the new server (#3) is about 2-3x slower, even without any table accesses. I've even run the following query and have still detected a 2x difference in speed:</p>
  
  <pre><code>SELECT 1; 
  </code></pre>
  
  <p>One example of a fairly simple but more than just a trivial query is:</p>
  
  <pre><code> SELECT COUNT(*) FROM users WHERE email LIKE '%ab%'
  </code></pre>
  
  <p>where users has approximately 18000 rows with email indexed.</p>
  
  <p>This query takes about 0.0090s on server #1.
  This query takes about 0.0270s on server #3.</p>
  
  <p>Server #3 is essentially idle with nothing else running on it. I haven't even installed antivirus software on it yet where #1 is under moderate load and #2 is nearly idle.</p>
  
  <p>The OS is certainly different but I wouldn't have expected a 2-3x performance loss on a newer OS version on a much faster machine on one application and no others.</p>
  
  <p>What am I missing????</p>
  
  <p>Server Configurations....</p>
  
  <p>Server #1 (circa 2008-09):</p>
  
  <ul>
  <li>Intel Core i7 Extreme Edition, 3.2 GHz(Nehalem, 4 core)</li>
  <li>Intel DX58SO Motherboard</li>
  <li>6 GB RAM (3 x 2GB)</li>
  <li>Windows 2008, 64 bit</li>
  <li>2 x Western Digital Black 640GB HD in Raid 1</li>
  <li>MySQL 5.6.16</li>
  <li>Connector ODBC 5.2</li>
  </ul>
  
  <p>Server #2 (circa 2010-11, with some upgrades):</p>
  
  <ul>
  <li>Intel Core i7, X995 @ 3.6 GHz (Westmere, 6-core)</li>
  <li>Intel DX58SO2 Motherboard</li>
  <li>12 GB RAM (3 x 4 GB)</li>
  <li>Windows 7 Professional, 64 bit</li>
  <li>1 x Intel SSD 480 GB (from 1-2 year ago)</li>
  <li>MySQL 5.6.16</li>
  <li>Connector ODBC 5.2</li>
  </ul>
  
  <p>Server #3 (2013-14):</p>
  
  <ul>
  <li>Intel Core i7-4770K @ 3.5 GHz (Broadwell, 4 core)</li>
  <li>ASUS Z87-WS Motherboard</li>
  <li>16 GB RAM (2 x 8GB, 1866)</li>
  <li>Windows Server 2012 R2, 64 bit.</li>
  <li>2 x Intel SSD DC S3500 160 GB in Raid 1</li>
  <li>MySQL 5.6.17</li>
  <li>Connector ODBC 5.2</li>
  </ul>
  
  <p>Here is a diff of the variables ("&lt;" represents server 1 where ">" represents server 3...with log file and server name differences removed):</p>
  
  <pre><code>diff Variables.Server1.csv Variables.Server3.csv
  18a19
  &gt; "block_encryption_mode","aes-128-ecb"
  22c23
  &lt; "character_set_database","latin1"
  ---
  &gt; "character_set_database","utf8"
  29c30
  &lt; "collation_database","latin1_swedish_ci"
  ---
  &gt; "collation_database","utf8_general_ci"
  
  99c100
  &lt; "innodb_autoextend_increment","1000"
  ---
  &gt; "innodb_autoextend_increment","64"
  206c207
  &lt; "innodb_version","5.6.16"
  ---
  &gt; "innodb_version","5.6.17"
  212c213
  &lt; "key_buffer_size","8388608"
  ---
  &gt; "key_buffer_size","268435456"
  
  335c336
  &lt; "pseudo_thread_id","12032"
  ---
  &gt; "pseudo_thread_id","4"
  
  430c431
  &lt; "timestamp","1396976138.845271"
  ---
  &gt; "timestamp","1396976213.390847"
  440c441
  &lt; "version","5.6.16"
  ---
  &gt; "version","5.6.17"
  </code></pre>