I am using Jenkins to build my Angular applications on Google Kubernetes Engine (GKE). At some point I noticed that the builds on GKE take significantly longer than it used to take on my old (private) environment so I started to perform some tests. It takes twice the amount of time in all cases on GCE. AWS, on the other hand is within a few % of my old private environment so I used it for comparison.
I slowly removed all the layers (Jenkins, Kubernetes, etc...) and kept
getting the same result. When running the builds directly on
n1-standard-1
and n1-highcpu-4
instances on GCE and on a t2-medium
instance on AWS for comparison, this is what I get:
Instance | vCPUs | Mem | Duration | Cost/Build
------------------+-------+------+----------+-----------
GCE:n1-standard-1 | 1 | 3.7G | 610642ms | $0.0089
GCE:n1-highcpu-4 | 4 | 3.6G | 472999ms | $0.018
AWS:t2-medium | 2 | 4.0G | 373039ms | $0.0051
I understand that one vCPU in GCE is backed by one hyper-thread but
looking at the table above, it is obvious that in GCE, the build takes longer and I am paying more. Even though using a n1-highcpu-4
I pay much more for the vCPU than a t2-medium
, it still takes longer to run the same workload.
Am I missing any machine type from Google that is more optimized for this kind of CPU intensive workload? Is anyone else running builds on GCE/GKE?