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

fix: WRN The open files limit is too low (1024) and may cause crash #280

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

Mikeburke14
Copy link
Contributor

The game can sometimes crashes with the following message, this PR applies this fix.

`2024-11-14T23:12:48 0.020 WRN The open files limit is too low (1024) and may cause crashes. Recommended is at least 10240. Follow these steps to increment it:
- Open /etc/security/limits.conf with a text editor: 'sudo editor /etc/security/limits.conf'
- Add or update the line: 'sdtdserver soft nofile 10240'
- Save the file and exit the editor
- Apply the changes: Log out and back in or restart the system`

@vinanrra
Copy link
Owner

vinanrra commented Nov 16, 2024

Hi @Mikeburke14 did you try to do this at your host machine?

Because I saw this issue GameServerManagers/LinuxGSM#4612, and it was resolved, setting the ulimit at host machine, because even if we increase the ulimit at the container it will be constrained by the host machine, I'm not sure if we also need to set this at the container.

@vinanrra vinanrra changed the title Fix for: WRN The open files limit is too low (1024) and may cause cra… fix: WRN The open files limit is too low (1024) and may cause cra… Nov 16, 2024
@vinanrra vinanrra changed the title fix: WRN The open files limit is too low (1024) and may cause cra… fix: WRN The open files limit is too low (1024) and may cause crash Nov 16, 2024
@Mikeburke14
Copy link
Contributor Author

Hi @vinanrra,

The problem is that the sdtdserver doesn't get the ulimit settings, our server got hit by this message a number of times

2024-11-14T23:12:48 0.020 WRN The open files limit is too low (1024) and may cause crashes. Recommended is at least 10240. Follow these steps to increment it:
- Open /etc/security/limits.conf with a text editor: 'sudo editor /etc/security/limits.conf'
- Add or update the line: 'sdtdserver soft nofile 10240'
- Save the file and exit the editor
- Apply the changes: Log out and back in or restart the system

This is the ulimit we saw for the container before appling the fix

(the value 1024000 was a test to double check it was appling it to the container)

root@aabbb158e02e:~# ulimit -a
real-time non-blocking time  (microseconds, -R) unlimited
core file size              (blocks, -c) unlimited
data seg size               (kbytes, -d) unlimited
scheduling priority                 (-e) 0
file size                   (blocks, -f) unlimited
pending signals                     (-i) 62537
max locked memory           (kbytes, -l) 64
max memory size             (kbytes, -m) unlimited
open files                          (-n) 1024000
pipe size                (512 bytes, -p) 8
POSIX message queues         (bytes, -q) 819200
real-time priority                  (-r) 0
stack size                  (kbytes, -s) 8192
cpu time                   (seconds, -t) unlimited
max user processes                  (-u) unlimited
virtual memory              (kbytes, -v) unlimited
file locks                          (-x) unlimited

And this is the ulimit for the user, with open files (-n) 1024

sdtdserver@aabbb158e02e:~$ ulimit -a
real-time non-blocking time  (microseconds, -R) unlimited
core file size              (blocks, -c) unlimited
data seg size               (kbytes, -d) unlimited
scheduling priority                 (-e) 0
file size                   (blocks, -f) unlimited
pending signals                     (-i) 62537
max locked memory           (kbytes, -l) 64
max memory size             (kbytes, -m) unlimited
open files                          (-n) 1024
pipe size                (512 bytes, -p) 8
POSIX message queues         (bytes, -q) 819200
real-time priority                  (-r) 0
stack size                  (kbytes, -s) 8192
cpu time                   (seconds, -t) unlimited
max user processes                  (-u) unlimited
virtual memory              (kbytes, -v) unlimited
file locks                          (-x) unlimited

On the host OS we had the ulimit set and could see the changes only seemed to apply to the root user of the container not the sdtdserver user (ulimits had been set for both userId 1000 and sdtdserver.

@vinanrra
Copy link
Owner

@Mikeburke14

Thanks for the PR, I will merge, as you wrote, it's recommended to have this increased

@vinanrra vinanrra merged commit 379068d into vinanrra:master Nov 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants