title: Runtime.getRuntime().availableProcessors() returning 1 even though many cores available on ECS AWS
body: <p>I am running a task via Docker on AWS's ECS. The task does some calculations which are CPU-bound, which I would like to run in parallel. I start a thread pool with the number of threads specified in <code>Runtime.getRuntime().availableProcessors()</code> which works fine locally on my PC. For some reason, on AWS ECS, this always returns 1, even though there are multiple cores available. Therefore my calculations run serially, and do not utilize the multiple cores.</p>
  
  <p>For example, right now, I have a task running on a "t3.medium" instance which should have 2 cores according to the <a href="https://aws.amazon.com/ec2/instance-types/t3/" rel="noreferrer">docs</a>. </p>
  
  <p>When I execute the following code:</p>
  
  <pre><code>System.out.println("Java reports " + 
      Runtime.getRuntime().availableProcessors() + " cores");
  </code></pre>
  
  <p>Then the following gets displayed on the log:</p>
  
  <pre><code>Java reports 1 cores
  </code></pre>
  
  <p>I do not specify the <code>cpu</code> parameter in ECS's task definition. I see that in the list of tasks within the ECS Management Console it has a column for "CPU" which reads 0 for my task. I also notice that in the list of instances (= VMs) it lists "CPU available" as 2048 which presumably has something to do with the fact the VM has 2 cores.</p>
  
  <p>I would like my Java program to see all cores that the VM has to offer. (As would normally be the case when a Java program runs on a computer without Docker).</p>
  
  <p>How do I go about doing that?</p>