Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace JSON library for targeted parsing of the Kubelet response #5109

Open
azdagron opened this issue Apr 30, 2024 · 1 comment
Open

Replace JSON library for targeted parsing of the Kubelet response #5109

azdagron opened this issue Apr 30, 2024 · 1 comment
Labels
help wanted Issues with this label are ready to start work but are in need of someone to do it priority/backlog Issue is approved and in the backlog

Comments

@azdagron
Copy link
Member

The Kubelet response can sometimes be quite large (i.e. larger than 1MiB). This has traditionally caused some performance problems.

#4231 replaced the use of the standard library encoding/json package with github.com/valyala/json which improved the CPU utilization by a fair margin. However, valyala/json has some fairly high memory requirements, as well as some bugs that make it retain memory longer than necessary. This has led to OOM conditions for SPIRE Agent (#5067). Unfortunately, valyala/json also seems to no longer be actively maintained, making reliance on it a risk to the project.

We should replace the valyala/json library with one that:

  1. Allows for targeted parsing of relevant pod information from the kubelet response (workload attestor is only interested in a single pod/container)
  2. Has favorable CPU/memory utilization
  3. Is actively maintained
@azdagron azdagron added help wanted Issues with this label are ready to start work but are in need of someone to do it priority/backlog Issue is approved and in the backlog labels Apr 30, 2024
@adeinega
Copy link

adeinega commented May 2, 2024

I'd suggest trying to go with https://github.com/go-json-experiment/json, have a look also at its goals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues with this label are ready to start work but are in need of someone to do it priority/backlog Issue is approved and in the backlog
Projects
None yet
Development

No branches or pull requests

2 participants