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

Managing minion cache size #40585

Closed
jdonofrio728 opened this issue Apr 7, 2017 · 8 comments
Closed

Managing minion cache size #40585

jdonofrio728 opened this issue Apr 7, 2017 · 8 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc. stale
Milestone

Comments

@jdonofrio728
Copy link

Description of Issue/Question

I'm running into an issue where my /var filesystem is completely filling up by the cache used by the salt-call command. I find myself running commands like below just to get the state to apply:

applications-clear-cache:
  cmd.run:
    - name: salt-call --local saltutil.clear_cache

I am downloading many large files from an artifact repository during the process.

Adding more disk space doesn't seem like the best solution for this. What configuration options do I have to keep the cache from filling up the disk?

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)
applications-installer:
archive.extracted:
- name: /sfs/tmp/osb-installer
- source: http://server:port/path/to/very/large/file
- skip_verify: True
- enforce_toplevel: False

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)
Run

#: salt-call --local state.highstate

To apply a state that downloads enough files to fill up the /var filesystem.

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

[vagrant@ets-01 ~]$ salt-call --version
salt-call 2016.11.3 (Carbon)

@Ch3LL
Copy link
Contributor

Ch3LL commented Apr 10, 2017

I believe that is by design to pull down the file and then extract the file form the cache. Are you suggesting a way to bypass the pull down of hte file to the cache to be able to extract the file?

Or are the files staying in the cache after you extract them?

@Ch3LL Ch3LL added the info-needed waiting for more info label Apr 10, 2017
@Ch3LL Ch3LL added this to the Blocked milestone Apr 10, 2017
@jdonofrio728
Copy link
Author

I'm more referring that the files are staying in cache. Im my case, I have ~5gb available on /var/cache, and while salt-call is running it is pulling dozens of files from an artifact repository form 50mb to ~1gb. After the filesystem fills up, rather than clearing old files from the cache, the state files running last fail to apply. This basically means that I need to maintain space on the filesystem for the file to pull down and stay, and space for its destination.

@sokratisg
Copy link

You could setup a periodic schedule, say every week or so, to execute saltutil.clear_cache or even better a cmd.run to check for files bigger than X MB and older than Y days.

@jdonofrio728
Copy link
Author

I could, but I don't think that ultimately solves the problem. I would think the salt should be smart enough to manage its own cache, and not fail just because it managed to file it up from previous run's or states.

@EvaSDK
Copy link
Contributor

EvaSDK commented May 3, 2018

The minion cache should definitely have some way of being cleaned automatically, just like master's jobs cache. Otherwise the cache grows indefinitely when updating states and it is not sane to have an agent not paying attention to its footprint.

@EvaSDK
Copy link
Contributor

EvaSDK commented May 3, 2018

This is actually already filled as #6759 and #34369.

@Ch3LL
Copy link
Contributor

Ch3LL commented May 13, 2019

thanks for linking those issues @EvaSDK

one thing to mention is that there is a keep_source argument in some of the file, archive states that will make sure its deleted. Might be an easy solution to allow that to also be a configuration setting. Also to ultimately solve this problem, would be good to add module/runner as that issue points to only clear the fileserver and then add a a config option that will run that on a schedule.

@Ch3LL Ch3LL added Feature new functionality including changes to functionality and code refactors, etc. team-core and removed info-needed waiting for more info labels May 13, 2019
@Ch3LL Ch3LL modified the milestones: Blocked, Approved May 13, 2019
@stale
Copy link

stale bot commented Jan 8, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jan 8, 2020
@stale stale bot closed this as completed Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. stale
Projects
None yet
Development

No branches or pull requests

4 participants