Categories
amazon-web-services aws-codebuild mysql phpunit symfony

AWS Codebuild containers very very SLOW

I just setup my Codebuild pipeline for PHP Symfony2 testing by phpunit.


Situation :

Some of our tests talk to a local Database (classic mysql-server)

Codebuild use our Custom Docker image that is based on php:5.6-apache

OS : Linux Alpine
PHP VERSION : 5.6

We execute these steps :

  1. Pull sources
  2. Setup database (All okey no latency)
  3. Composer install (5 min)
  4. php app/console doctrine:schema:update --force
  5. php app/console broadway:event-store:schema:init
  6. Launch phpUnit.

On local environment (Docker with 6GB RAM Allow) everything is okey.

The whole process takes like 15 Minutes… perfect.


Problem :

When i launch the build on the same image on AWS-CodeBuild this is very much longer :

  1. Pull sources (Instant)
  2. Setup database (Instant)
  3. Composer install (5min)
  4. php app/console doctrine:schema:update --force(14 min)
  5. php app/console broadway:event-store:schema:init (Instant)
  6. phpUnit (Infinity CodeBuild timeout)


Hypothesis :

It seems like all php process that access to the DB is super slow.

Classic MySQL requests have a ‘normal’ speed…

If someone got an idea ?

Thanks for your help

@Rops42