pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.31k stars 1.55k forks source link

Wings Memory Issue #5115

Open Verox001 opened 1 month ago

Verox001 commented 1 month ago

Current Behavior

When letting Wings run for a few hours, the memory usage skyrockets to 23.3G. Yesterday (after letting the server run for 6 days) the memory usage had reached 80G.

sudo service wings status
● wings.service - Pterodactyl Wings Daemon
     Loaded: loaded (/etc/systemd/system/wings.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-06-04 10:39:57 CEST; 2s ago
   Main PID: 21776 (wings)
      Tasks: 18 (limit: 96471)
     Memory: 19.1M
        CPU: 91ms
     CGroup: /system.slice/wings.service
             └─21776 /usr/local/bin/wings

Expected Behavior

Wings shouldn't be using that much memory to be honest. Also, when restarting the Wings process, the memory consumption of wings seems to go down to an acceptable value, even though the host still uses up this memory, which can only be solved by a reboot.

Steps to Reproduce

Start your Wings process on Debian 12 and let it run for a few hours.

Panel Version

1.11.3

Wings Version

1.11.13

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

I'm just getting a lot of failed SFTP logins from these cyber-crimininality clients.

Is there an existing issue for this?

Verox001 commented 1 month ago
sudo free -h
               total        used        free      shared  buff/cache   available
Mem:            78Gi        14Gi        39Gi       3.7Mi        24Gi        63Gi
Swap:          974Mi          0B       974Mi

Important to note is that the cache seems to be extremly high, which seems to be the cause of the high memory usage.

Jcodeerd commented 1 month ago

I never really paid attention to it, but now you mention it: I'm on Ubuntu 22.04 with wings 1.11.12, however I believe the last 2 commits shouldn't have effect on memory usage

● wings.service - Pterodactyl Wings Daemon
     Loaded: loaded (/etc/systemd/system/wings.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-05-03 18:38:33 UTC; 1 month 1 day ago
   Main PID: 3187774 (wings)
      Tasks: 60 (limit: 153442)
     Memory: 25.0G
        CPU: 1month 1d 1h 53min 55.118s
     CGroup: /system.slice/wings.service
             └─3187774 /usr/local/bin/wings
               total        used        free      shared  buff/cache   available
Mem:           124Gi        95Gi       1.1Gi        54Mi        28Gi        28Gi
Swap:             0B          0B          0B
Verox001 commented 1 month ago

@Jcodeerd Okay, seems like you're having the same issue as me. I found a dirty, but effective solution: You can set MemoryMax as bytes in your service file under the [Service] tag to 10 Mb - 50 Mb, to limit the memory consumption. I set it to 50 Mb (52428800), just in case and it seems to doesn't affect Wings at all. It throttles perfectly at 50 Mb and doesn't use any more cache. You have to reload the systemctl daemon after that (systemctl daemon-reload) and reboot your server to get rid of the cache.

Of course that isn't an optimal solution and this has something to dore with Wings overall, so I'd like @matthewpi to have a look at this.