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

Clean tmp dir on start-up #2235

Open
zdyj3170101136 opened this issue Nov 15, 2023 · 9 comments
Open

Clean tmp dir on start-up #2235

zdyj3170101136 opened this issue Nov 15, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@zdyj3170101136
Copy link
Contributor

Describe the bug
agent continous oom, and produce too much data in tmp dir.

Expected behavior
server should not oom, even oom it should not produce too much data.

server should clean up all tmp dir when restarted.
Screenshots or Profiles (using https://pprof.me)

截屏2023-11-15 下午5 55 27

Reason

the agent want to upload debuginfo of clickhouse server, which is 2GB.
this request is rejected by parca server in default when server is normal.

but my s3 have some problem, so the server would retuen all InitialUploadRequest with true.

and my agent version is v0.15.0, so it will return true when err is not nil:
https://github.com/parca-dev/parca-agent/blob/v0.15.0/pkg/debuginfo/manager.go#L329

the agent would create tmp debuginfo when InitialUploadRequest err is not nil.

the agent would easily oom with too much concurrent creating of tmp debuginfo file.

the agent would create permanent tmp debuginfo file when oom.

so finally the disk usage is 100 percent.

@zdyj3170101136
Copy link
Contributor Author

the bug is fixed in newly released.

but i want the agent cleanup all tmp directory when started to prevent any possible oom.

@brancz
Copy link
Member

brancz commented Nov 15, 2023

I think cleaning up the debuginfo temp dir is a valid request. Do you want to create a PR to add this?

@zdyj3170101136
Copy link
Contributor Author

I think cleaning up the debuginfo temp dir is a valid request. Do you want to create a PR to add this?

i noticed the shouldInitiateUploadResponseCache is removed in latest agent.

Is it necessary? it could reduce many calls and correspond s3 request.

@brancz
Copy link
Member

brancz commented Nov 16, 2023

Did you find the commit that removed it?

@kakkoyun
Copy link
Member

i noticed the shouldInitiateUploadResponseCache is removed in latest agent.

If this is the case, it's not intentional. Could you point us to the culprit commit?

@zdyj3170101136
Copy link
Contributor Author

i noticed the shouldInitiateUploadResponseCache is removed in latest agent.

If this is the case, it's not intentional. Could you point us to the culprit commit?

127ce4e#diff-5c4a0ca9a2747c99b32f629099e552b2582da981ff90f6bcedd6044dbe11e359L220

@kakkoyun kakkoyun added the bug Something isn't working label Nov 22, 2023
@kakkoyun
Copy link
Member

i noticed the shouldInitiateUploadResponseCache is removed in latest agent.

If this is the case, it's not intentional. Could you point us to the culprit commit?

127ce4e#diff-5c4a0ca9a2747c99b32f629099e552b2582da981ff90f6bcedd6044dbe11e359L220

I don't think this is the root cause of the problem.
You can see in the same changeset, we merely changed the location of the cache 127ce4e#r133359657

@kakkoyun
Copy link
Member

kakkoyun commented Nov 23, 2023

However, we can add something to clean the given temporary directory as part of the start-up sequence or periodically.

Contributions are welcome 🤗

@kakkoyun kakkoyun removed the bug Something isn't working label Nov 23, 2023
@kakkoyun kakkoyun changed the title continous oom and disk usage 100 percent Continuous OOM and disk usage 100 percent when target object storage unavailable constantly Nov 23, 2023
@brancz
Copy link
Member

brancz commented Nov 23, 2023

I think on startup sounds good!

@kakkoyun kakkoyun added the enhancement New feature or request label Feb 22, 2024
@kakkoyun kakkoyun changed the title Continuous OOM and disk usage 100 percent when target object storage unavailable constantly Clean tmp dir on start-up Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants