[BBS] Use scheduling info instead of the whole desiredLRP
klapkov opened this issue · comments
Use scheduling info instead of the whole desiredLRP
Summary
There are two places where I see we can make some optimisations:
When crashing a ActualLRP:
https://github.com/cloudfoundry/bbs/blob/main/controllers/actual_lrp_lifecycle_controller.go#L207
In requestAuction() which is called when we evacuate a Claimed or Running actualLRP: https://github.com/cloudfoundry/bbs/blob/main/controllers/evacuation_controller.go#L387
In both cases we fetch a whole desiredLRP and use only the scheduling info. This could be avoided by directly fetching the scheduling info only. This way we in cases where the RunInfo of an desiredLRP is really large in size, we will not waist resources and time fetching in when we do not use it. The change is small, but I can see some improvements to be gained here.
The only point against the change I see is that sadly the DesiredLRPSchedulingInfo returns an array. so we need to check if it is empty and use the first element if not. This maybe introduce a little bit of confusion and the code is not as clean as before. Anyhow, if anyone has ideas on how to better do this, please leave a comment. Will try to collect some performance data in the following days to share as well.
Diego repo
https://github.com/cloudfoundry/bbs
Describe alternatives you've considered (optional)
Proposal PR: cloudfoundry/bbs#79