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

[xray] add GOMAXPROCS env in statefulset from limits.cpu values #1783

Closed
wants to merge 2 commits into from

Conversation

gregoryboue
Copy link

@gregoryboue gregoryboue commented Jun 22, 2023

PR Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • Chart Version bumped
  • CHANGELOG.md updated
  • Title of the PR starts with chart name (e.g. [artifactory])

What this PR does / why we need it:

Settings GOMAXPROCS is a good practice for running go applications in kubernetes.

Customers who are running xray on kubernetes with cgroup v2 can encounter some performance issue due to cgroup v2 cpu management for go application.

For more information see theses post :

@github-actions
Copy link

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@gregoryboue
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@gregoryboue
Copy link
Author

recheck

@chukka
Copy link
Collaborator

chukka commented Jun 26, 2023

@gregoryboue Thanks for the PR , we would like test it internally and come back on this , Hopefully we would be adding this in next release of Xray (ETA in couple of weeks)

@gregoryboue
Copy link
Author

@chukka thanks for the answer, there is one problem with my PR, this only can work if ressource.limitCpu is an integer (for example this won't work : '500m' '1.5'.

I didn't success to manage it and i didn't want to add GOMAXPROCS as chart values.

@chukka
Copy link
Collaborator

chukka commented Jun 27, 2023

@gregoryboue Ideally , Can we use automacprocs which automatically set GOMAXPROCS to match Linux container CPU quota
https://pkg.go.dev/go.uber.org/automaxprocs
https://github.com/uber-go/automaxprocs

Till each microservice implements it , it better we have it in chart values via extraEnvVars ,WDYT ?

@gregoryboue
Copy link
Author

useless since Xray 3.79 and internal usage of https://github.com/uber-go/automaxprocs

@gregoryboue gregoryboue closed this Sep 7, 2023
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.

3 participants