apheleia-project / jbs-build-issues

0 stars 0 forks source link

CPU Usage #12

Closed rnc closed 4 months ago

rnc commented 5 months ago

This somewhat relates to https://github.com/apheleia-project/jbs-issues/issues/11 and is also mentioned in my doc

Essentially it seems that building kotlin based projects (e.g. Kotlin, kotlinx-coroutines) takes considerably longer on the cluster than on my local machine (whether building within the diagnostic container or directly). For example kotlinx-coroutines takes ~1hr while on my machine it takes ~few minutes.

I see that we set the CPU as follows:

pkg/reconciler/dependencybuild/buildrecipeyaml.go
556:    limits.defaultRequestCPU, err = resource.ParseQuantity(settingOrDefault(jbsConfig.Spec.BuildSettings.TaskRequestCPU, "10m"))
560:    limits.defaultLimitCPU, err = resource.ParseQuantity(settingOrDefault(jbsConfig.Spec.BuildSettings.TaskLimitCPU, "300m"))
564:    limits.buildRequestCPU, err = resource.ParseQuantity(settingOrDefault(jbsConfig.Spec.BuildSettings.BuildRequestCPU, "300m"))

This ends up in the yaml as (after my experimental change):

 containers:
    - resources:
        limits:
          cpu: '2'
          memory: 5Gi
        requests:
          cpu: '2'
          memory: 5Gi

Tracing back through the history it has always been 300m ( cc @stuartwdouglas )

Background in

Experimenting with setting that to 2 (which I think means 2 CPU versus the current of 30% of one CPU) dropping the kotlinx-coroutines down to ~10min versus 1hr :

image

image

rnc commented 5 months ago

Spoke to @stuartwdouglas offline and he suggested we remove the limits.