Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High server load messages / low CPU utilization #113

Open
1 task done
LuxKeiwoker opened this issue Nov 14, 2024 · 7 comments
Open
1 task done

High server load messages / low CPU utilization #113

LuxKeiwoker opened this issue Nov 14, 2024 · 7 comments
Labels
bug 🐞 Something isn't working

Comments

@LuxKeiwoker
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Used image version

latest - 1d77460

Used docker compose file or docker command

services:
  enshrouded:
    image: mornedhels/enshrouded-server:latest
    container_name: enshrouded
    hostname: enshrouded
    restart: unless-stopped
    stop_grace_period: 90s
    ports:
      - "15637:15637/udp"
    volumes:
      - ./game:/opt/enshrouded
    environment:
      - SERVER_NAME=Enshrouded Server
      - SERVER_PASSWORD=secret
      - UPDATE_CRON=*/30 * * * *
      - PUID=4711
      - PGID=4711

What you expected to see, versus what you actually saw

I'm running this container on a Synology NAS with AMD Ryzen CPU and 6 Cores/12 Threads. As soon as more than one player is connected, the game starts complaining about high server load or even excessive load. While looking into the CPU utilization of the container I see only a utilization of up to 300 %, i.e 3 cores or threads.

The Synology Resource Manager (kind of a taskmanager like in Windows) shows a Cpu utilization of only around 20 %. I've tried many things like redeploying the container, turning on resource restriction, turning it off. Setting the priority of the container to high and even started messing with the docker -cpushares parameter through ssh. Nothing has ever increase CPU utilization.

At this point I suspect somethings off with the container, rather than the host machine or configuration.

Any ideas?

Logs from the container

No response

@LuxKeiwoker LuxKeiwoker added the bug 🐞 Something isn't working label Nov 14, 2024
@Zaarrg
Copy link

Zaarrg commented Nov 14, 2024

+1 Got exactly the same issue. With only 2 players got rubber banding and the high server load message in game. Server has more then enough resources with a i5 13500, 20 threads and 64gb, 1 GBit/s network. Meanwhile the enshrouded server used max 2gb ram with a max load of 300% aswell.
No idea if its a docker image issue or enshrouded as i found also a recent reddit post with the same issue.

@cp-fabian-pittroff
Copy link
Member

Hey there, well I'm experience the same on my setup. I mostly get messages but the game is still playable with 4. In Discord I see also some complains about the performance even on windows servers.

So unfortunately I can't do anything but wait for fixes from the core enshrouded server. A native linux server would also help, so I can get rid of the wine virtualization.

For now you can only try out the stable-wine version aswell. Some reported it worked better on their setup.

@LuxKeiwoker
Copy link
Author

LuxKeiwoker commented Nov 15, 2024

For now you can only try out the stable-wine version aswell. Some reported it worked better on their setup.

Can this use the already existing data folder and savegame for the wine version, or do I need to migrate the savegame to a new data folder?

Edit: I read you can define CPU affinity in proto through WINE_CPU_TOPOLOGY variable. I'm no expert for proton so not sure where to look for this setting. Do you maybe know?

This is from the official proton repository

https://github.com/search?q=repo%3AValveSoftware%2FProton%20WINE_CPU_TOPOLOGY&type=code

if "PROTON_CPU_TOPOLOGY" in self.env:
--
1299 | self.env["WINE_CPU_TOPOLOGY"] = self.env["PROTON_CPU_TOPOLOGY"]
1300 | elif appid in default_cpu_limit:
1301 | self.env["WINE_CPU_TOPOLOGY"] = str(default_cpu_limit[appid])

Wonder what the "default_cpu_limit[appid]" is

Edit2:

Found this in the Proton sources.

default_cpu_limit = {
    "19900"     :  16,  # Far Cry 2
    "298110"    :  16,  # Far Cry 4
    "20920"     :  16,  # The Witcher 2: Assassins of Kings Enchanced Edition
    "35130"     :  16,  # Lara Croft and the Guardian of Light
    "55150"     :  16,  # Warhammer 40,000: Space Marine
    "204450"    :  16,  # Call of Juarez: Gunslinger
    "15620"     :  8,   # Warhammer 40,000: Dawn of War II
    "20570"     :  8,   # Warhammer 40,000: Dawn of War II - Chaos Rising
    "56400"     :  8,   # Warhammer 40,000: Dawn of War II - Retribution
    "618970"    :  4,   # Outcast - Second Contact
    "10150"     :  8,   # Prototype
    "2229830"   :  1,   # Command & Conquer and The Covert Operations
}

Seems like some games don't like high core count so the limit what the game sees by the appid. Enshrouded is not on the list.

@cp-fabian-pittroff
Copy link
Member

Can this use the already existing data folder and savegame for the wine version, or do I need to migrate the savegame to a new data folder?

You can use the same setup, just switch to the other docker tag and start it back up. If you run into problems, you would migrate the savegames or use one of the backup zip files.

I never played around with the CPU_TOPOLOGY env vars, but enshrouded is spawning a lot of threads, so I don't think that would be a problem in that case. It seems that you need a cpu with a high single core performance, so the main thread can keep up.

If you want to play around with the proton or wine env vars, just slap them on your docker compose or docker command and start/restart you docker container. The env variable is passed to the start script and gets picked up by proton/enshrouded.

services:
  enshrouded:
    ...
    environment:
      ...
      - PROTON_CPU_TOPOLOGY=4

PROTON_CPU_TOPOLOGY=6

supervisord: enshrouded-server DEBUG - [72] - PROTON_CPU_TOPOLOGY: 6
...
supervisord: enshrouded-server     Type:      AMD
supervisord: enshrouded-server     Cpus:      6
supervisord: enshrouded-server         Perf:  6 111111

PROTON_CPU_TOPOLOGY: 4

supervisord: enshrouded-server DEBUG - [72] - PROTON_CPU_TOPOLOGY: 4
...
supervisord: enshrouded-server     Type:      AMD
supervisord: enshrouded-server     Cpus:      4
supervisord: enshrouded-server         Perf:  4 1111

And don't be surprised, the debug log is not available in the current builds.

@LuxKeiwoker
Copy link
Author

Thanks, yes the CPU_Topology env var is being passed on, I can see it from the logs, but it doesn't seem to have any (positive) effect on CPU usage. It's still capped to 3 cores/threads.

I've tried the wine-dev container and that did actually help to reduce the number of ingame messages. I also noticed that the wine image consumes far more RAM (I've seen >5,5 GB with 2 Players) while the Proton image is using barely more than 1 GB, so I guess that is one reason why there is less rubberbanding. But the CPU usage is also capped with the wine image.

@Victonator
Copy link

I'm encountering performance issue's as well. I'm hosting a server for 3 players.
First I tried the proton image with alot of performance issue's in busier areas. Reading this issue I switched to the wine image and that did make a good difference, but not enough in busier area's, still a lot of performance issue's.
Switching to wine-dev from wine-stable did not make a difference and neither did limiting cores/threads in my expirience.

It's using about ~300% CPU and ~3Gb of ram with lots more resources avalible.

@Firleznarf
Copy link

We have the same messages in the server, when more than 2 people are on the server. When we have 4, the problems become worse and someone losts connection sometimes. We have an I5 4590 in the system. What is really different to the other is our used ram memory. Normally the server uses 12 GB and with 4 poleople on the Server up to 15 GB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants