trustification / trustify

Apache License 2.0
10 stars 18 forks source link

Excessive memory use of graphql endpoint #750

Open ctron opened 1 week ago

ctron commented 1 week ago

While working on the loadtests, I noticed excessive memory usage of the trustd API process. I had to increase the memory for trustd from 2 GiB to 16 GiB to have it success at least once.

It turned out that the culprit was the grapgql endpoint. Disabling those tests made the loadtest success with 2 GiB.

While I do understand that just disabling the tests isn't the best idea, it's the only one that works for running those tests on the GitHub CI, as we only have 7 GiB total there.

On the other side, if a single graphql user can cause a memory consumption of more than 10 GiB, then I think we have a problem that needs to be addressed.

I would propose the following steps:

JimFuller-RedHat commented 1 week ago

Alternately - in the future we might consider a (read only) graphql interface built on top of a graph representation- that will probably be more contained in terms of memory usage. Otherwise maintaining a graphql on top of relational models may mean we have to constrain interface to avoid problematic usage areas.

bobmcwhirter commented 1 week ago

tagging @gildub to investigate