saltstack / saltstack/salt

GitFS cause extra high CPU usage on the master

Open
#42,081 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending-discussion
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:

screen shot 2017-07-03 at 1 56 30 pm

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.