tonymmm1 / vmangos-docker

This is a Docker project for the vmangos core
16 stars 3 forks source link

Add a ulimit in the mangos server docker-compose definition. #17

Open unixtreme opened 5 months ago

unixtreme commented 5 months ago

This is a very minor thing but I noticed while running vmangos on my steamdeck on a heavily modified version of your repo (way back when it was hosted somewhere else).

Arch tends to have an unlimited ulimit default which will be used by docker, and mangos in turn will try to cap it out. The issue will present itself as an ACE malloc failure.

Setting ulimits on the container definition in docker-compose.yml resolved the issue for me. Unfortunately, determining a "sane" ulimit here is highly dependent on the hardware platform where the container is running, and the available memory, so instead it would probably be better to determine what would be the limits that satisfy Mangos requirements which I'm not 100% certain about.

mserajnik commented 4 weeks ago

The maximum number of open file descriptors directly limits how many players can connect simulatenously. As it currently stands, memory is allocated for every potential file descriptor, which in combination with certain environments/setups (e.g., as you already pointed out, with Docker on Arch Linux), can cause a huge amount of memory allocation. See the discussion in https://github.com/vmangos/core/pull/2575 for some more information. This issue should be fixed automatically once ACE gets removed from VMaNGOS.

In the meantime, setting a value like 1024 should be fine as a default (and matches the default on many/most Linux distributions), assuming most people will not run servers with larger populations. For my own VMaNGOS Docker solution, I have done just that (and added a comment explaining the rationale so the user can adjust the value as necessary).