vtex-apps/reviews-and-ratings

Inaccuracy in cpu request

valentino-amadeus opened this issue · 3 comments

Describe the bug
The value added to your service.json as cpu request is inaccurate by a factor of 10: if you want to request 250m of CPU, you should put 25 into the value field of your service.json. More information on that here.

I would open a PR, but apparently I don't have permission for that.

It isn't, @wender. In the example, the app is requesting 2000 millicores of cpu. Under normal circumstances, you can request up to 800 millicores, but there are some apps that have extended permission - and can request up to 2000. render-to-string is one of those.

I'm getting back here to remind you about this issue.
Because of the bound on the amount of cpu that reviews-and-ratings can request, the clusters are allocating 800m of cpu to each of the app's pods (pod ~ instance), instead of the value that's declared in the app's service.json (2500m). I don't think you should change this. In fact, it is common to see one of the app's instances using almost as much cpu as the 800m it gets.
In the image below, the metrics for the last 6 hours.
Captura de Tela 2021-03-16 às 09 14 26

But I do think it would be good to adjust the service.json of this app. The 250 value in the cpu field can be replaced with 80. It would avoid future confusion and ensure that the clusters never allocate more than 800m of cpu to reviews-and-ratings, even if the bound we currently have gets removed or increased.