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

more appropriate GOMEMLIMIT modification #386

Open
sanposhiho opened this issue Mar 21, 2024 · 1 comment
Open

more appropriate GOMEMLIMIT modification #386

sanposhiho opened this issue Mar 21, 2024 · 1 comment
Assignees
Labels
kind/feature New feature or request

Comments

@sanposhiho
Copy link
Contributor

What happened seemingly

When Tortoise is configured to vertically scale up/down resource, Tortoise basically calculates recommended resource requests by {VPA's recommendation} *1.1 (1.1 is configurable through BufferRatioOnVerticalResource)

Also, Tortoise keeps the ratio of GOMEMLIMIT to memory request.
It means, if GOMEMLIMIT is configured to be 80% of the memory request right now, tortoise keeps the ratio even after it changes the memory request.

GOMEMLIMIT is a soft limit, it means, obviously, "GOMEMLIMIT: 1MiB" doesn't mean the memory consumption does never go beyond 1MiB. Based on this fact, one service encounters this issue seemingly:

  1. GOMEMLIMIT is configured around 90% of memory request. Meaning the memory consumption would be always around 90%+.
  2. VPA suggests nearly the current memory request.
  3. Tortoise calculates the recommendation by VPA's value * 1.1. Because of (2), it increases the memory request a bit.
  4. go back to (1) and never stops.

What Tortoise should do instead

We don't want to stop multiplying 1.1 to VPA's value for safety.
We can just stop modifying GOMEMLIMIT, at least for now.

The downside to do that would be that, if the application is changed and starts to consume memory a lot more, GC runs more often and it negatively impacts the CPU consumption.

@sanposhiho sanposhiho added the kind/bug Something isn't working label Mar 21, 2024
@sanposhiho sanposhiho self-assigned this Mar 21, 2024
@sanposhiho sanposhiho added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Mar 21, 2024
@sanposhiho
Copy link
Contributor Author

The quick patch is done with #387.

@sanposhiho sanposhiho removed the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Mar 22, 2024
@sanposhiho sanposhiho changed the title Tortoise keeps increasing memory when GOMEMLIMIT is fairly high more appropriate GOMEMLIMIT modification Mar 23, 2024
@sanposhiho sanposhiho added kind/feature New feature or request and removed kind/bug Something isn't working labels Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant