You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
캐시 TTL을 5분으로 했는데, 최신 데이터 반영에는 좋지만 자주 조회되는 데이터고 만료될 때마다 평균을 계속 계산해야하는 로직인데 성능상 괜찮을까요?!
실시간성을 얼마나 잡느냐 관점에 따라 다를 수 있을 것 같지만 저는 5분 정도가 적절하다고 생각해서 우선 설정을 해 놨습니다. 그런데 5분 만료 뒤에 첫 요청 시 조회 속도가 느려지는 것이 문제가 될 수 있으니 5분보다 먼저 스케줄러 작업해서 캐시 업데이트 해 놓는 것도 방법인 것 같습니다. 제가 생각했을 때는 계산 작업으로 주기적으로 서버에 부담이 가는게 걱정되기 보다는 ttl 만료 후 첫 요청 시 속도가 느려지는게 걱정인데, 송현님 생각하시기에는 계산 작업 횟수 자체를 줄여서 서버에 부담이 안가게 하는게 더 맞다고 보시나요??
넵 그 방법 외에는 잘 떠오르지 않는 것 같습니다. 아니면 횟수 자체를 줄이지 말고, 계산되는 시간 자체를 줄일 수 있게 조금 더 신경써서 쿼리 튜닝이랑 정산 로직 개선해볼 수 있을 것 같습니다. 그리고 TTl은 적합하게 다시 설정하고 아까 말씀드린 것 처럼 ttl 만료 전에 스케줄러로 캐시 업데이트 해놓을 수 있을 것 같습니다.
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
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.
🌱 관련 이슈
📌 작업 내용 및 특이사항
🔍 참고사항
📚 기타