optimus icon indicating copy to clipboard operation
optimus copied to clipboard

Pass only ProjectID and NamespaceID where rest of config is not required

Open sbchaos opened this issue 3 years ago • 0 comments

Observation: Optimus is using more memory than expected, and gets evicted out of cluster for breaching memory limits.

To reduce the amount of memory used by application, we can pass only the required things to downstream services, so that we are not adding a lot of pressure on memory.

Example in store/postgres/secret_repository.go the following function exists

func (repo *secretRepository) Update(ctx context.Context, project models.ProjectSpec, namespace models.NamespaceSpec, spec models.ProjectSecretItem) error {

We require only ProjectID and NamespaceID in this function as argument. Similarly in other functions we can pass the respective ID.

sbchaos avatar Jun 23 '22 10:06 sbchaos