Skip to content

Commit

Permalink
perf: ⚡️ lower threads over the weekend (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskaransarkaria authored Oct 18, 2024
1 parent 08b8686 commit 355062b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/environment/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (a *Apply) applyNamespaceDirs(chunkFolder []string) error {

chunkStream := util.Generator(done, chunkFolder...)

routineResults := a.parallelApplyNamespace(done, chunkStream, 2) // goroutines are very lightweight and can number in millions, but the tasks we are doing are very heavy so we need to limit this as much as possible
routineResults := a.parallelApplyNamespace(done, chunkStream, 1) // goroutines are very lightweight and can number in millions, but the tasks we are doing are very heavy so we need to limit this as much as possible

results := util.FanIn(done, routineResults...)

Expand All @@ -208,7 +208,7 @@ func (a *Apply) applyNamespaceDirs(chunkFolder []string) error {

func (a *Apply) parallelApplyNamespace(done <-chan bool, dirStream <-chan string, numRoutines int) []<-chan string {
if a.Options.IsApplyPipeline {
runtime.GOMAXPROCS(3) // this is based on https://github.com/ministryofjustice/cloud-platform-infrastructure/blob/ebafd84ba45a18deeb113d1b57f565141368c187/terraform/aws-accounts/cloud-platform-aws/vpc/eks/cluster.tf#L46C1-L46C58 current max cpu is 4 (for workloads running in concourse)
runtime.GOMAXPROCS(1) // this is based on https://github.com/ministryofjustice/cloud-platform-infrastructure/blob/ebafd84ba45a18deeb113d1b57f565141368c187/terraform/aws-accounts/cloud-platform-aws/vpc/eks/cluster.tf#L46C1-L46C58 current max cpu is 4 (for workloads running in concourse)
}

routineResults := make([]<-chan string, numRoutines)
Expand Down

0 comments on commit 355062b

Please sign in to comment.