GitFS cause extra high CPU usage on the master
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description of Issue/Question
Over the last 6-12 months we've found state.apply to be very slow and causing very high CPU usage on our salt master. We have about 20 formulas, one external state tree with the master top file and one external pillar, each in separate Git repos.
While debugging I decided to disable the git fileserver in the master configuration and go back to using the basic roots file system, creating a CRON job to simulate gitfs by running git pull every 30 seconds.
This small change has made state.apply over 10x faster than it was before and has lowered CPU usage on the salt master so much that we've been able to reduce it from a 6vCPU 8GB instance to a 2vCPU 4GB instance and still achieve a lower average CPU usage than before.
Here is the before and after CPU usage on the salt master:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the high CPU usage and slow state.apply behavior with the GitFS fileserver enabled, then compare it with the basic roots filesystem and periodic git pull described in the report. Trace the GitFS path involved in state.apply; done means identifying the cause of the performance difference and providing a verified fix or clear diagnosis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100