Repository navigation
Fix: 큰 게임의 예열이 메모리 한도 근처에서 읽다가 취소하기를 되풀이함 - #184
Merged
Merged
Conversation
읽을 범위를 "가용 − 256 − 예비량"으로 잡고, 읽는 도중에는 "최종 집합 > 지금 가용 − 예비량" 이면 취소했습니다. 계획 뒤 가용 메모리가 256 MiB 만 줄어도 취소됐고, 취소된 시도가 읽은 것은 대부분 기록에 남지 않아 다음 시도가 처음부터 다시 읽었습니다. 로그에서 보충 예열 취소가 93회였고 그중 79회(읽은 양 합계 51,624 MiB)는 기록에 아무것도 더하지 못했습니다. - 읽는 도중 메모리 한도에 걸리면 취소하지 않고 지금 들어가는 범위로 줄여 마무리하고 읽은 양을 기록함 - 범위가 줄어도 이어 읽기 위치를 버리지 않고, 새로 읽을 것이 없으면 디스크를 읽지 않음 - 보충 예열은 들어가는 범위가 읽은 양보다 max(256 MiB, 5%) 이상 클 때만 시작함 - 틈을 메우는 계획은 읽는 양과 순서를 그대로 두고, 한도에 걸리면 읽은 양을 보수적으로만 기록함 - 보충이 메모리를 기다리는 게임도 재예열 점검에서 읽은 범위의 사다리를 만듦 - 읽을 게임이 없는 트리거는 락을 기다리지 않고 바로 건너뜀을 기록함 - 메모리 예비량과 캐시 예산은 그대로 둠 Issues #179
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
csharp/src/AsterCache.Service/Prewarm.Run.cs,PrewarmPolicy.cs,Prewarm.Memory.cs: 읽는 도중 메모리 한도에 걸리면 지금 들어가는 범위(가용 − 예비량)를 다시 계산해, 읽은 양이 그 이상이면 그 자리에서 마무리하고 미만이면 그 범위까지 읽고 마무리합니다. 판정은 순수 함수입니다.csharp/src/AsterCache.Service/Prewarm.Supplement.cs: 보충 예열은 범위가 줄어도 이어 읽기 위치를 버리지 않고, 새 범위가 읽은 곳 이하이면 표본도 읽지 않고 끝납니다. 들어가는 범위가 읽은 양보다 max(256 MiB, 5%) 이상 클 때만 시작하며, 못 미치면<게임>: supplement waits for memory (read X MiB, room for Y MiB)를 상태가 바뀔 때만 남깁니다. 틈을 메우는 계획은 읽는 양·범위·순서가 그대로이고, 한도에 걸리면 읽은 양을 보수적으로만 기록합니다.csharp/src/AsterCache.Service/Rewarm.cs,Rewarm.Ladder.cs: 보충이 메모리를 기다리는 게임도 재예열 점검에서 표본이 따뜻하면 읽은 범위의 사다리를 만듭니다. 메모리가 늘 모자란 게임이 순서 보호를 받지 못하던 경로를 막은 것입니다.csharp/src/AsterCache.Service/Prewarm.Trigger.cs,Prewarm.Status.cs: 트리거가 고른 게임이 모두 건너뛸 것이면 락을 기다리지 않고 바로 건너뜀을 기록합니다.알아 둘 점
Test plan
dotnet build csharp -c Release -m:1경고 0, 오류 0dotnet test csharp/tests/AsterCache.Tests -c Release --no-build --filter "Category!=Live"4,436건 통과 (첫 실행에서 부하로 실패한 2건은 이 변경과 무관한 시험으로, 단독 재실행과 전체 재실행에서 통과)dotnet format csharp --verify-no-changes통과git diff --check이상 없음build-test통과: https://github.com/DO0OG/AsterCache/actions/runs/43498046074/job/132136220357Closes #179