AWS Codebuild containers very very SLOW
Asked Answered
K

2

6

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

Kalila answered 4/10, 2017 at 17:52 Comment(0)
M
1

I recommend you first to confirm your hypothesis - since it could be the most likely issue - by enabling MySQL logs (Error Log, General Log, and Slow Queries Log) in your build process and analyze them during or after the build.

If you don't find anything relevant that explains the slowness in those log files, you could use something like Blackfire to profile the code in CodeBuild, and you will find what is precisely slowing down the execution.

Marnie answered 15/3, 2018 at 5:51 Comment(0)
E
0

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

Epidaurus answered 11/1, 2022 at 20:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.