title: Better way to disable hyper threading in AWS EC2?
body: <p>I am doing some benchmarking tests and would like to disable hyper threading in an EC2 to see it's effect on my test application performance.</p>
  
  <p>A single instance of my application uses only 1 thread during execution.</p>
  
  <p>I understand that I can't access the BIOS of EC2 machines to disable hyper threading since they are all virtualised. But I have used the <code>chcpu</code> command to disable half the vCPUs(threads) available so that I could simulate a hyper threading disabled environment.</p>
  
  <p>For this benchmark, I am using a C4.xlarge with 4vCPUs numbered logically from 0 to 3.</p>
  
  <p>I run this command <code>sudo chcpu -d 1,3</code> which disables vCPUs 1 and 3.</p>
  
  <p>In doing this, I assume that vCPUs 0 and 1 come from a single underlying bare metal core and vCPUs 2 and 3 come from another core.</p>
  
  <p>This is where I know that my assumptions are wrong since vCPUs 0 and 4 could be coming from the same bare metal core or all of them could be coming from different bare metal cores.</p>
  
  <p>Does anybody have a better way to disable hyper-threading in EC2 instances?</p>
  
  <p>Also does Amazon rearrange vCPUs so that they come from different cores when it detects half the vCPUs being disabled?</p>