title: AWS Codebuild containers very very SLOW
body: <p>I just setup my <strong>Codebuild</strong> pipeline for PHP Symfony2 testing by phpunit.  </p>
  
  <hr>
  
  <p><strong>Situation :</strong><br>
  Some of our tests talk to a local Database (classic mysql-server)</p>
  
  <p><em>Codebuild</em> use our Custom Docker image that is based on <code>php:5.6-apache</code><br>
  <code>OS : Linux Alpine 
  PHP VERSION : 5.6</code></p>
  
  <p>We execute these steps :  </p>
  
  <ol>
  <li>Pull sources</li>
  <li>Setup database (All okey no latency)</li>
  <li>Composer install (<strong>5 min</strong>)</li>
  <li><code>php app/console doctrine:schema:update --force</code></li>
  <li><code>php app/console broadway:event-store:schema:init</code></li>
  <li>Launch <em>phpUnit</em>.</li>
  </ol>
  
  <p>On local environment (Docker with 6GB RAM Allow) everything is okey.<br>
  The whole process takes like <strong>15 Minutes</strong>... perfect.</p>
  
  <hr>
  
  <p><strong>Problem :</strong>  </p>
  
  <p>When i launch the build on the same image on <strong>AWS-CodeBuild</strong> this is very much longer :</p>
  
  <ol>
  <li>Pull sources (<strong>Instant</strong>)</li>
  <li>Setup database (<strong>Instant</strong>)</li>
  <li>Composer install (<strong>5min</strong>)</li>
  <li><code>php app/console doctrine:schema:update --force</code>(<strong>14 min</strong>)</li>
  <li><code>php app/console broadway:event-store:schema:init</code> (<strong>Instant</strong>)</li>
  <li><em>phpUnit</em> (<strong>Infinity</strong> CodeBuild timeout)</li>
  </ol>
  
  <hr>
  
  <p><strong>Hypothesis :</strong><br>
  It seems like all php process that access to the DB is super slow.<br>
  Classic MySQL requests have a 'normal' speed...</p>
  
  <p>If someone got an idea ?<br>
  Thanks for your help<br>
  @Rops42</p>