go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

What is the relation between CpuThreshold option and request/limit cpu resource k8s deployment config?

Open SgtDaJim opened this issue 1 year ago • 3 comments

I am using go-zero in a service deployed on k8s, and I set request / limit cpu 4 cores (4000m). I found that the range of CpuThreshold is [0:1000), so I set 950. Under this config, I found my service cannot occupy all the cpu I request, and the rpc service will response service overloaded when cpu usage is near 1000m。 What can I do to make my service occupy all the resource I request?

SgtDaJim avatar Jul 22 '24 08:07 SgtDaJim

950 means 95% of your cpu limit. And 95% is a moving average value, you can consider it as the average value of last 5 seconds.

kevwan avatar Jul 22 '24 11:07 kevwan

950 means 95% of your cpu limit. And 95% is a moving average value, you can consider it as the average value of last 5 seconds.

that is strange. I review my config, I set resource like this: image

then i got an error before (time is UTC): image

but at that time, cpu monitoring looked like this: image

it seems not touching the threshold.

SgtDaJim avatar Jul 26 '24 08:07 SgtDaJim

Hi, any update?

SgtDaJim avatar Aug 02 '24 03:08 SgtDaJim

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 04 '25 02:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 06 '25 02:11 github-actions[bot]