egebilecen / PZServerDiscordBot

A Project Zomboid Discord Bot written in C# using Discord.NET to manage and execute commands on Project Zomboid Server.
GNU General Public License v3.0
62 stars 11 forks source link

Terminal Window freezing #67

Closed JayPaypers closed 1 year ago

JayPaypers commented 1 year ago

When using the bot, every so often the terminal window will become unresponsive. The server will stay up, but be unjoinable showing “server not responding” in game. Anyone in the server will stay in the server, but clients will only see themselves and none of the progress gets saved from when the freeze happens. It will only fox when I manually close the terminal window and relaunch the server. There isn’t any indication of errors or anything that I could see in the terminal window, and there doesn’t seem to be a specific time or query causing the freeze.

egebilecen commented 1 year ago

Hey, Sounds like a RAM or CPU usage issue to me. Could you try to run your server without using the bot and monitor it if same issue will occur?

JayPaypers commented 1 year ago

Hey, Sounds like a RAM or CPU usage issue to me. Could you try to run your server without using the bot and monitor it if same issue will occur?

It’s running on a PC with Windows 11, i5-11400, 16Gb ram. I have 8GB allocated for the server in the ini. I’ll keep it running for the next couple hours and see if it freezes again. As a quick note, before I discovered this bot, we did not experience this issue when the server was up for more than 4+ hours.

egebilecen commented 1 year ago

Hey, Sounds like a RAM or CPU usage issue to me. Could you try to run your server without using the bot and monitor it if same issue will occur?

It’s running on a PC with Windows 11, i5-11400, 16Gb ram. I have 8GB allocated for the server in the ini. I’ll keep it running for the next couple hours and see if it freezes again. As a quick note, before I discovered this bot, we did not experience this issue when the server was up for more than 4+ hours.

Hmm. How many players are on the server? 8gb isn’t high if you have quite a bit of players and PZ exceptionally eats lots of RAM. Just open up the task manager time to time and check your RAM usage. If server eats around 7-8gb RAM, then that’s the issue. Other than that I can’t think anything else as currently a server is running this bot for more than 7 days without even closing the terminal for restarts etc. Could you immediately send me the bot log file (program.log) if terminal freezes again in your tests?

JayPaypers commented 1 year ago

At most we’ve had 5 people playing on the server. But the freeze has happened with just one or 2 people on and playing. I have noticed the ram usage getting up close to 8GB, so I’ll keep an eye on that. Would 16 be recommended? I use this Pc for other things so I figured half should be enough with the amount of players being around 5 at most.

JayPaypers commented 1 year ago

Here is the last log i have after it crashed earlier today. pzbot.log

Looks like some fun things happened at the end there. Could it be something with the autorestart?

egebilecen commented 1 year ago

At most we’ve had 5 people playing on the server. But the freeze has happened with just one or 2 people on and playing. I have noticed the ram usage getting up close to 8GB, so I’ll keep an eye on that. Would 16 be recommended? I use this Pc for other things so I figured half should be enough with the amount of players being around 5 at most.

5 people should't eat too much RAM but I am not expert of PZ MP.

Here is the last log i have after it crashed earlier today. pzbot.log

Looks like some fun things happened at the end there. Could it be something with the autorestart?

Nothing seems off in the logs. Autostart is a schedule that runs every 10 seconds to check if server process is alive so it is perfectly fine to see bunch of autostart logs. I am leaning to that either it's a mod issue (if there are any) otherwise try to increase the RAM amount to 12GB and see if it will make any difference.