diff options
| author | yangwei <[email protected]> | 2023-12-25 16:57:19 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2023-12-25 17:02:52 +0800 |
| commit | ee6fc641018252eee590ef17324d8ba32355b47c (patch) | |
| tree | 1fac3cb9b6215985ac5df723078f9c74986b1cc2 /src/support | |
| parent | 382f15bd1b7ddc220f08fa0b275a8566603e8ed1 (diff) | |
✨ feat(CPU limit): 使用EWMA计算CPU占用,α取值0.8
Diffstat (limited to 'src/support')
| -rw-r--r-- | src/support/cpu_limit/cpu_limit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/support/cpu_limit/cpu_limit.c b/src/support/cpu_limit/cpu_limit.c index 3ea9203..e21738e 100644 --- a/src/support/cpu_limit/cpu_limit.c +++ b/src/support/cpu_limit/cpu_limit.c @@ -278,9 +278,9 @@ static void cl_analysis(cpu_limit_inner_t *h) if(this_stat->realtime_res_val >= h->user_trigger_value){//超最高限制阈值 cl_analysis_reduce_state(h, tid, this_stat); - if(this_stat->realtime_res_val >= 99.0 && MESA_handle_runtime_log_level_enabled(ABBR_PROCESS_LATENCY_LOG_HANDLE, RLOG_LV_FATAL)) + if(this_stat->realtime_res_val >= 99.9 && MESA_handle_runtime_log_level_enabled(ABBR_PROCESS_LATENCY_LOG_HANDLE, RLOG_LV_FATAL)) { - sapp_process_latency_log(RLOG_LV_FATAL, "cpu_limit usage over 99%%, send SIGUSR2 to thread:%d, tid:%d", tid, sapp_global_val->individual_fixed.thread_obtain_id[tid]); + sapp_process_latency_log(RLOG_LV_FATAL, "[cpu_limit] thread:%d usage:%.2f over 99.9%%, send SIGUSR2 to tid:%d", tid, this_stat->realtime_res_val, sapp_global_val->individual_fixed.thread_obtain_id[tid]); pthread_kill(sapp_global_val->individual_fixed.thread_obtain_id[tid], SIGUSR2); } }else{ |
