AWS Codebuild containers very very SLOW

Viewed 2373

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

2 Answers

My codebuild project provisioning time was very high because of using ancient standard containers. after i upgraded to latest container, the provisioning time improved 5x. Maybe unrelated to the original post but may help folks who are suffering from bad codebuild performance because of high provisioning time

Related