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

mistserv.conf is not loaded #167

Open
EvgenyKirichenko opened this issue Apr 9, 2023 · 8 comments
Open

mistserv.conf is not loaded #167

EvgenyKirichenko opened this issue Apr 9, 2023 · 8 comments

Comments

@EvgenyKirichenko
Copy link

Hello, guys.

Faced with this situation. I have CentOS 9 server running (8 GB Memory / 25 GB Disk). The size of the configuration file has reached 123 KB, the server can't read it on startup. I deleted the config file, the server started instantly. I returned the config file, increased the RAM size to 16GB, didn't help. I have a suspicion that the issue here is not the amount of memory, but the fact that the entire configuration is written in one line, now it has reached such a size that the script, which reads config line by line, can not do it. Advice on what to do? Perhaps the approach to reading config should be reconsidered.

@Thulinma
Copy link
Contributor

Thulinma commented Apr 9, 2023

Hey there!
The config is actually read character by character, not line by line (newlines are completely ignored by the system).
So the problem is definitely not that the config is a single file 🤔. (And the parser has been tested with files up to several gigabytes in size, so the 123KiB size should not be a problem, either...)

Could you share a copy of your config, so that we can analyse what's wrong?
If you don't want to post it publicly, feel free to instead email it to [email protected]

@EvgenyKirichenko
Copy link
Author

EvgenyKirichenko commented Apr 9, 2023 via email

@cyberj0g
Copy link

cyberj0g commented Apr 9, 2023

BTW shouldn't the config get pretty printed on exit?

#113

@nerijus
Copy link

nerijus commented Apr 9, 2023

Yes, it would be nice to merge to development branch too.

@EvgenyKirichenko
Copy link
Author

EvgenyKirichenko commented Apr 10, 2023

A small addition, perhaps a significant one.
I add new streams via API, and after each call I force saving the config.

@EvgenyKirichenko
Copy link
Author

Is there any news on this subject?
I switched the configuration file saving mode, now it is saved only when the server is stopped. Unfortunately, this did not help. Another reboot generated a configuration file of 124,547 bytes and the server cannot get up. The file itself is valid -- I checked it with a json parser.
I sent the file to the mailbox [email protected]

@Rokamun
Copy link
Contributor

Rokamun commented May 1, 2023

Hey there,

We received the config and had a look. The amount of streams configured most likely would've hit the file descriptor limit (usually 1024) of your system. As we keep a file open per stream configured (to work towards Windows compatibility, Windows shared memory requires keeping everything in shared memory "active" or it would be deleted)

You can test or work around this problem by raising the limit applied to MistServer.

If you're using MistServer as a service you could raise this by adding the following to the mistserver.service file:
LimitNOFILE=5000
This goes into the [Service] section.
Don't forget to systemctl daemon-reload and then (re)start MistServer

If you don't want to edit the service script immediately you can test it by hand. First turn off the mistserver service then:
ulimit -n 5000
then:
MistController -c /etc/mistserver.conf

Seeing this issue we'll most likely make adjustments for the Linux builds to not keep all these files open as it's not needed.
Thanks for reporting!

By the way, while there's no problem in having 1k+ streams configured, you might want to look into the wildcard system, which allows you to do this in a much more simple way.
The following article should explain you how to set this up:
https://news.mistserver.org/news/90/How+to+build+a+Twitch-alike+service+with+MistServer

@EvgenyKirichenko
Copy link
Author

Thank you for your prompt reply.
I will definitely take your advice and monitor the server's behavior.

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

No branches or pull requests

5 participants