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

Reduce controller memory footprint considerably #3394

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

markmandel
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug

/kind cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

In the past it wasn't deemed necessary to give the sub-controllers of the GameServer controller (Health, Missing and Migration) more than 1 worker for their queues, as speed of processing wasn't hugely important for their particular workloads.

An unfortunate consequence of that is that their queues can back up quite significantly, since they can't process events very fast at all. causing big jumps in memory usage.

This change brings those controllers in line with all the others, such that they have the same number of workers as every other controller - and now we have a much more stable memory footprint for the controller since they can process their incoming events in a timely manner.

Which issue(s) this PR fixes:

Closes #3380

Special notes for your reviewer:

Added a couple of extra checks to queuing as well.

In the past it wasn't deemed necessary to give the sub-controllers of
the GameServer controller (Health, Missing and Migration) more than 1
worker for their queues, as speed of processing wasn't hugely important
for their particular workloads.

An unfortunate consequence of that is that their queues can back up
quite significantly, since they can't process events very fast at all.
causing big jumps in memory usage.

This change brings those controllers in line with all the others, such
that they have the same number of workers as every other controller -
and now we have a much more stable memory footprint for the controller
since they can process their incoming events in a timely manner.

Closes googleforgames#3380
@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc area/operations Installation, updating, metrics etc labels Sep 21, 2023
@github-actions github-actions bot added the kind/bug These are bugs. label Sep 21, 2023
Copy link
Collaborator

@gongmax gongmax left a comment

Choose a reason for hiding this comment

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

I guess the only possible downside is the CPU usage could go up since more processes?

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gongmax, markmandel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@markmandel
Copy link
Member Author

I guess the only possible downside is the CPU usage could go up since more processes?

You ask an interesting question, so I went back and looked at the metrics!

Interestingly, it's actually a little less! I wonder if having all that memory backing up makes things difficult for the CPU and/or also garbage collection.

image

@markmandel
Copy link
Member Author

@Kalaiselvi84 this would be a good one to have in the release notes for sure 👍🏻

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: e6305fea-1736-4938-974c-cdb09ec0aa74

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3394/head:pr_3394 && git checkout pr_3394
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-a53c9ad-amd64

@markmandel markmandel enabled auto-merge (squash) September 21, 2023 04:37
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@google-oss-prow google-oss-prow bot removed the lgtm label Sep 21, 2023
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 558342be-407f-4002-8ef3-7840081ee663

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3394/head:pr_3394 && git checkout pr_3394
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-18e1d19-amd64

@markmandel markmandel merged commit 18163e8 into googleforgames:main Sep 21, 2023
@markmandel markmandel deleted the ops/reduce-memory branch September 21, 2023 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/operations Installation, updating, metrics etc area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/bug These are bugs. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agones Controller Memory leak to 460M
3 participants