Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GOMAXPROCS for MaxConcurrentReconciles #142

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Conversation

bdevcich
Copy link
Contributor

Update this to be consistent with our other controllers. I believe this equates to 128, but setting this programmatically is probably the better way to go.

Update this to be consistent with our other controllers. I believe this
equates to 128, but setting this programmatically is probably the better
way to go.

Signed-off-by: Blake Devcich <[email protected]>
return ctrl.NewControllerManagedBy(mgr).
For(&nnfv1alpha1.NnfDataMovement{}).
WithOptions(controller.Options{MaxConcurrentReconciles: 128}).
WithOptions(controller.Options{MaxConcurrentReconciles: maxReconciles}).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GOMAXPROCS defaults to the number of CPUs. How many are on a rabbit?
The cmd.wait() likely allows Go to pick up another go proc, if one is available. So this controller can probably handle many more data movements than GOMAXPROCS would allow.

I wonder if this controller should even have a max setting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that it should default to 1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, no. I hadn't realized that was the default. It should be a high number. Let's stay with 128 until we see a reason to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does equal 128 on the rabbit nodes:

root@nnf-dm-worker-pctgf:~# ./maxprocs
maxReconciles: 128
root@nnf-dm-worker-pctgf:~# nproc
128

Here's the code for ./maxprocs:

package main

import (
	"fmt"
	"runtime"
)

func main() {
	maxReconciles := runtime.GOMAXPROCS(0)
	fmt.Printf("maxReconciles: %d\n", maxReconciles)
}

@bdevcich bdevcich merged commit 9c7d43c into master Nov 28, 2023
4 checks passed
@bdevcich bdevcich deleted the max-reconcilers branch November 28, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants