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

suicide immediately when resource hard limit is met #1649

Merged
merged 3 commits into from
Jul 31, 2024
Merged

Conversation

henryzhx8
Copy link
Collaborator

每5秒检查一次cpu和内存是否达到硬限制(10倍设定上限),如果达到立即自杀

@@ -451,7 +463,7 @@ bool LogtailMonitor::CheckCpuLimit() {
return false;
}

bool LogtailMonitor::CheckMemLimit() {
bool LogtailMonitor::CheckSoftMemLimit() {
if (mMemStat.mRss > AppConfig::GetInstance()->GetMemUsageUpLimit()) {
if (++mMemStat.mViolateNum > INT32_FLAG(mem_limit_num))
Copy link
Collaborator

Choose a reason for hiding this comment

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

间隔变了,这里次数没变?

@@ -451,7 +463,7 @@ bool LogtailMonitor::CheckCpuLimit() {
return false;
}

bool LogtailMonitor::CheckMemLimit() {
bool LogtailMonitor::CheckSoftMemLimit() {
if (mMemStat.mRss > AppConfig::GetInstance()->GetMemUsageUpLimit()) {
if (++mMemStat.mViolateNum > INT32_FLAG(mem_limit_num))
Copy link
Collaborator

Choose a reason for hiding this comment

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

间隔变了,这里次数没变?

@henryzhx8 henryzhx8 added the enhancement Feature enhancement label Jul 31, 2024
@henryzhx8 henryzhx8 added this to the v2.0 milestone Jul 31, 2024
@henryzhx8 henryzhx8 merged commit d680348 into main Jul 31, 2024
15 checks passed
@henryzhx8 henryzhx8 deleted the fix/monitor branch July 31, 2024 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants