Skip to content

[BUG] salt-proxy memory leak [3002] #58813

Closed

Description

@whytewolf

Description
I didn't notice this one before because of the master memory leak was more prompant. but while testing some fixes for that issue I see that my salt-proxy minions also were growing in memory requirements.

Setup
same setup as #58785 only setup salt-proxy minion.

Steps to Reproduce the behavior
same setup as #58785 only setup salt-proxy minion and wait.

[root@salt00 ~]# ps aux | grep salt
root     23678  1.0  0.3 1206772 58364 ?       Ss   19:08   0:01 /usr/bin/python3 /usr/bin/salt-master ProcessManager
root     23682  0.0  0.1 305356 25512 ?        S    19:08   0:00 /usr/bin/python3 /usr/bin/salt-master MultiprocessingLoggingQueue
root     23690  0.0  0.2 514392 45540 ?        Sl   19:08   0:00 /usr/bin/python3 /usr/bin/salt-master ZeroMQPubServerChannel
root     23693  0.0  0.2 449784 46100 ?        S    19:08   0:00 /usr/bin/python3 /usr/bin/salt-master EventPublisher
root     23694  3.0  0.3 1209100 58276 ?       S    19:08   0:03 /usr/bin/python3 /usr/bin/salt-master
root     23695  0.1  0.3 439188 48796 ?        S    19:08   0:00 /usr/bin/python3 /usr/bin/salt-master
root     23696  1.6  0.6 1310040 103464 ?      S    19:08   0:02 /usr/bin/python3 /usr/bin/salt-master Maintenance
root     23881  0.1  0.3 1213112 56724 ?       S    19:08   0:00 /usr/bin/python3 /usr/bin/salt-master EventReturn
root     23885  0.0  0.3 1206596 50104 ?       S    19:08   0:00 /usr/bin/python3 /usr/bin/salt-master ReqServer_ProcessManager
root     23892  0.0  0.3 1222888 50604 ?       Sl   19:08   0:00 /usr/bin/python3 /usr/bin/salt-master MWorkerQueue
root     23897  1.4  0.4 1226496 67824 ?       Sl   19:08   0:01 /usr/bin/python3 /usr/bin/salt-master MWorker-0
root     23900  1.1  0.3 1217644 59368 ?       Sl   19:08   0:01 /usr/bin/python3 /usr/bin/salt-master MWorker-1
root     23907  1.1  0.3 1216604 59416 ?       Sl   19:08   0:01 /usr/bin/python3 /usr/bin/salt-master MWorker-2
root     23911  1.3  0.3 1223568 63108 ?       Sl   19:08   0:01 /usr/bin/python3 /usr/bin/salt-master MWorker-3
root     23912  1.1  0.3 1217696 59432 ?       Sl   19:08   0:01 /usr/bin/python3 /usr/bin/salt-master MWorker-4
root     23915  0.3  0.3 1208820 57136 ?       Sl   19:08   0:00 /usr/bin/python3 /usr/bin/salt-master FileserverUpdate
root     25587  2.6  0.1 299880 28320 ?        Ss   19:10   0:00 /usr/bin/python3 /usr/bin/salt-minion
root     25593  9.9  0.3 1468944 51836 ?       Sl   19:10   0:01 /usr/bin/python3 /usr/bin/salt-minion KeepAlive MultiMinionProcessManager MinionProcessManager MinionProcessManager
root     25595  0.0  0.1 379084 25424 ?        S    19:10   0:00 /usr/bin/python3 /usr/bin/salt-minion KeepAlive MultiprocessingLoggingQueue
root     25950  0.0  0.0 112812   968 pts/0    S+   19:10   0:00 grep --color=auto salt
root     29785  0.0  0.1 295776 24136 ?        Ss   Oct22   0:00 /usr/bin/python3 /usr/bin/salt-proxy --proxyid=sg300-backend
root     29786  0.0  0.1 295776 24128 ?        Ss   Oct22   0:00 /usr/bin/python3 /usr/bin/salt-proxy --proxyid=sg300-main
root     29788  0.0  0.1 295776 24132 ?        Ss   Oct22   0:00 /usr/bin/python3 /usr/bin/salt-proxy --proxyid=sg500-52
root     29798  0.3 12.8 2965680 2084316 ?     Sl   Oct22  14:17 /usr/bin/python3 /usr/bin/salt-proxy --proxyid=sg300-main MultiMinionProcessManager MinionProcessManager ProxyMinion._thread_ret
root     29799  0.3 12.8 3030804 2081544 ?     Sl   Oct22  14:20 /usr/bin/python3 /usr/bin/salt-proxy --proxyid=sg500-52 MultiMinionProcessManager MinionProcessManager ProxyMinion._thread_ret
root     29800  0.3 12.8 2964884 2082020 ?     Sl   Oct22  14:23 /usr/bin/python3 /usr/bin/salt-proxy --proxyid=sg300-backend MultiMinionProcessManager MinionProcessManager ProxyMinion._thread_ret

Expected behavior
salt=proxy doesn't slowly eat memory.

Screenshots
No screenshot on this one cause I run my salt-proxies on my salt-master so the graphs look like they reflect the master memory leak.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
[root@salt00 ~]# salt-proxy --versions
Salt Version:
           Salt: 3002

Dependency Versions:
           cffi: 1.14.0
       cherrypy: 5.6.0
       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 26, 2020
  2. added
    severity-high
    and removed on Oct 27, 2020
  3. added this to the 3002.1 milestone on Oct 27, 2020
  4. modified the milestones: 3002.2, Aluminium on Nov 23, 2020
  5. added
    Aluminium
    on Dec 7, 2020
  6. sagetherage commented on Jan 4, 2021

    @sagetherage
    Contributor

    @garethgreenaway this still may be pending and need work in Aluminium

  7. removed their assignment
    on Jan 11, 2021
  8. modified the milestones: Aluminium, Silicon on Mar 22, 2021
  9. sagetherage commented on Mar 24, 2021

    @sagetherage
    Contributor

    @whytewolf you should see improvements with Aluminium have you tested this with RC1?

  10. modified the milestones: Silicon, Aluminium on Mar 24, 2021
  11. added
    Aluminium
    on Mar 24, 2021
  12. TheBirdsNest commented on Sep 21, 2021

    @TheBirdsNest

    @sagetherage I still see this issue in 3003.2

    Salt Version:
              Salt: 3003.2
     
    Dependency Versions:
              cffi: 1.14.5
          cherrypy: Not Installed
          dateutil: 2.8.1
         docker-py: 4.4.4
             gitdb: Not Installed
         gitpython: Not Installed
            Jinja2: 2.11.3
           libgit2: Not Installed
          M2Crypto: 0.35.2
              Mako: Not Installed
           msgpack: 0.6.2
      msgpack-pure: Not Installed
      mysql-python: Not Installed
         pycparser: 2.20
          pycrypto: Not Installed
      pycryptodome: 3.10.1
            pygit2: Not Installed
            Python: 3.6.8 (default, Nov 16 2020, 16:55:22)
      python-gnupg: Not Installed
            PyYAML: 5.4.1
             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-1160.36.2.el7.x86_64
            system: Linux
           version: CentOS Linux 7 Core
    

    I need to run a large number of proxies so the leak is quite obvious.

    image

    The screenshot below shows used memory (I have 252Gb RAM on this host).
    I had to restart everything several times as it keeps running out of memory..

    image

    On that that note; is the delta proxy planned to be an Open Source component?

  13. TheBirdsNest commented on Sep 21, 2021

    @TheBirdsNest

    For what it's worth; I need to run 6500 proxy minions concurrently to manage my network; if this is the current state of play, are there any workarounds or suggestions to reduce the memory issues? I run these over 5 servers, 1300 each. These servers are very expensive and very large with 252GB RAM each and still they run out of resources after a matter of hours :(

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

Metadata

Metadata

Assignees

Labels

Aluminiumbugseverity-high

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions