Skip to content

[BUG] extreme memory leak in Maintenance process. #58785

Closed

Description

@whytewolf

Description
salt 3002 just installed last night. woke up this morning to find all memory and most of the swap taken up. checked ps aux | grep salt before restarting service to get memory back. found that the maintenance processes was the only large memory hog.

Setup
install 3002 and wait.

Steps to Reproduce the behavior
install 3002 and have minions.

Expected behavior
I have memory on my system after only a day of having a newly updated system.

Screenshots
mem leak

the little uptick at 18:00 is when I installed 3002.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:                                                                    
           Salt: 3002                                                            
                                                                                 
Dependency Versions:                                                             
           cffi: 1.14.0                                                          
       cherrypy: unknown                                                         
       dateutil: Not Installed                                                   
      docker-py: Not Installed                                                   
          gitdb: Not Installed                                                   
      gitpython: Not Installed                                                   
         Jinja2: 2.11.1                                                          
        libgit2: 0.26.6                                                          
       M2Crypto: 0.35.2                                                          
           Mako: Not Installed                                                   
   msgpack-pure: Not Installed                                                   
 msgpack-python: 1.0.0                                                           
   mysql-python: Not Installed                                                   
      pycparser: 2.20                                                            
       pycrypto: Not Installed                                                   
   pycryptodome: 3.9.8                                                           
         pygit2: 0.26.4                                                          
         Python: 3.6.8 (default, Apr  2 2020, 13:34:55)                          
   python-gnupg: 2.3.1                                                           
         PyYAML: 3.13                                                            
          PyZMQ: 17.0.0                                                          
          smmap: Not Installed                                                   
        timelib: Not Installed                                                   
        Tornado: 4.5.3                                                           
            ZMQ: 4.1.4                                                           
                                                                                 
System Versions:                                                                 
           dist: centos 7 Core                                                   
         locale: UTF-8                                                           
        machine: x86_64                                                          
        release: 3.10.0-1127.13.1.el7.x86_64                                     
         system: Linux                                                           
        version: CentOS Linux 7 Core                                             

Additional context
Add any other context about the problem here.

Activity

  1. added
    bug
    on Oct 22, 2020
  2. whytewolf commented on Oct 22, 2020

    @whytewolf
    CollaboratorAuthor

    after further testing, this might be related to SSE products' interaction with the maintenance process. The bug could still be in both products so will keep this open for now.

  3. whytewolf commented on Oct 22, 2020

    @whytewolf
    CollaboratorAuthor

    sse_mem_leak

    screenshot from another master that had sse enabled then I disabled it.

  4. whytewolf commented on Oct 22, 2020

    @whytewolf
    CollaboratorAuthor

    so after leaving one of my masters out of SSE for a little bit it looks like most of the leak is with SSE. however, I am still seeing a small bit of leak almost unnoticeable without sse running. want to give it more time maybe 24 hours to be sure.

  5. tuxthepenguin84 commented on Oct 22, 2020

    @tuxthepenguin84

    I can confirm I'm seeing similar behavior as well on my Salt Master (3002), just upgraded today and ran into the same issue.
    Edit:
    -Running Ubuntu 20.04 with 67 minions.
    image
    Graph starts with Salt-Master running 3001.1, then right after the upgrade to 3002 you can see an increase in memory usage. I've since reverted back to 3001.1 and everything is fine.

  6. whytewolf commented on Oct 23, 2020

    @whytewolf
    CollaboratorAuthor

    ok, After leaving my system up for 24 hours without SSE. There is still a memory leak. on this system, it is slow but present. since this system I'm testing with only has about 7 minions that could explain why it is slow. With more minions, I can see this being a much faster leak. This system also doesn't have git_pillar like an earlier system I saw this on. it has no extra bells or whistles setup.

  7. Arderos commented on Oct 23, 2020

    @Arderos

    I can confirm this behavior with salt-master 3002 and Ubuntu 18.04
    image

  8. added
    v3002.2
    on Oct 23, 2020
  9. jbouter commented on Oct 24, 2020

    @jbouter
    Contributor

    Can confirm with salt-master 3002 and Ubuntu 20.04 LTS

    Screenshot from 2020-10-24 10-47-21

  10. jeffdyke commented on Oct 25, 2020

    @jeffdyke

    There are enough fancy graphs (thanks folks!), i have 3 salt masters all 3002, on ubuntu 20.04 EC2 t3.small instances, which has always been sufficient. Prod has 20 minions, Staging has 9, and dev varies but right now is down to 4. All three had OOM errors and the OS reaped the process on each server. All salt master instances, run salt master/minion, cloudwatch agent, wazuh-agent and nothing else. I rebooted the dev version (4 minions) last night and right now its up to 60% of the memory is taken by salt master. I've set up a cron for these systems to restart the master at 90%, as it completely took down the instance in one environment and i could only be restarted via aws console/cli.

    Just adding this b/c i don't think it has to do with the # of minions, or other software interfering. Also i am not using sse on these instances.

  11. added this to the 3002.1 milestone on Oct 27, 2020
  12. added
    severity-critical
    on Oct 27, 2020
  13. 5 remaining items

  14. added this to the Aluminium milestone on Nov 23, 2020
  15. removed their assignment
    on Jan 11, 2021
  16. litnimax commented on Feb 18, 2021

    @litnimax

    We have memory leak for salt-minion KeepAlive MultiMinionProcessManager MinionProcessManager.
    Does it relate to this issue?

  17. mirceaulinic commented on Feb 19, 2021

    @mirceaulinic
    Contributor
  18. jeffdyke commented on Feb 19, 2021

    @jeffdyke

    For @litnimax and @mirceaulinic . I have not seen this problem after an upgrade to the official release of 3002.02. Unfortunately i forget if i purged anything or reinstalled, but i don't think so, as i would normally report that back. Of course it could still happen, this is my setup right now, and all is fine:

    alt Version:
              Salt: 3002.2
     
    Dependency Versions:
              cffi: Not Installed
          cherrypy: Not Installed
          dateutil: 2.7.3
         docker-py: Not Installed
             gitdb: 2.0.6
         gitpython: 3.0.7
            Jinja2: 2.10.1
           libgit2: Not Installed
          M2Crypto: Not Installed
              Mako: Not Installed
           msgpack: 0.6.2
      msgpack-pure: Not Installed
      mysql-python: Not Installed
         pycparser: Not Installed
          pycrypto: Not Installed
      pycryptodome: 3.6.1
            pygit2: Not Installed
            Python: 3.8.5 (default, Jul 28 2020, 12:59:40)
      python-gnupg: 0.4.5
            PyYAML: 5.3.1
             PyZMQ: 18.1.1
             smmap: 2.0.5
           timelib: Not Installed
           Tornado: 4.5.3
               ZMQ: 4.3.2
     
    System Versions:
              dist: ubuntu 20.04 focal
            locale: utf-8
           machine: x86_64
           release: 5.4.0-1037-aws
            system: Linux
           version: Ubuntu 20.04 focal
    
    
  19. added
    v3002.2
    on Mar 29, 2021
  20. sagetherage commented on Mar 29, 2021

    @sagetherage
    Contributor

    closing as addressed in v3002.2 - with more work to be done to continue to improve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugseverity-criticalv3002.2

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions