title: service was unable to place a task because no container instance met requirements. The closest matching container-instance has insufficient CPU units
body: <p>I am trying to run 2 tasks on the same EC2 container. The EC2 container is running on a <code>t2.large</code> type EC2 instance. 
  One of the tasks (which is a daemon) starts fine and is <code>RUNNING</code>.
  The other task which is an application, does not start and I see the following errors in the Events tab. </p>
  
  <pre><code>service test-service was unable to place a task because no container instance met all of its requirements. The closest matching container-instance xxxxxx has insufficient CPU units available. For more information, see the Troubleshooting section.
  
  service test-service was unable to place a task because no container instance met all of its requirements. The closest matching container-instance xxxxxx has insufficient memory available. For more information, see the Troubleshooting section.
  </code></pre>
  
  <p>I looked at the CPU and memory section for the container instance and the values are - </p>
  
  <pre><code>       Registered  Available
  CPU    1024         1014
  Memory  985         729
  </code></pre>
  
  <p>My task definitions for the task that does not run has the following CPU and Memory values - </p>
  
  <pre><code>    "memory": 512,
      "cpu": 10
  </code></pre>
  
  <p>The daemon that successfully runs on the same EC2 container instance also has the same values for memory and CPU. </p>
  
  <p>I read thru the AWS docs here at <a href="https://aws.amazon.com/premiumsupport/knowledge-center/ecs-container-instance-requirement-error/" rel="nofollow noreferrer">https://aws.amazon.com/premiumsupport/knowledge-center/ecs-container-instance-requirement-error/</a> and tried to reduce the CPU and memory requirements for the test-service task definition but nothing helped. I also changed the instance type to something bigger but that did not help either.</p>
  
  <p>Can someone please help me with what I should do CPU and memory for both the tasks (daemon and application) so they can run on the same EC2 container instance ? </p>
  
  <p>Note: I cannot add another container to the ECS cluster.</p>