pate-trigger (Palworld)'s dedicated server auto restarter in async python for mitigating memory leak.
There is also an attempt to backup your save data.
- Clone the project
pipenv install- Get the dedicated server files
- Put the two
.batfiles there - Configure the server options in the
Start server.batfile - Configure the constants at around the top of
main.pyfile - Rename
secrets.template.jsonback tosecrets.json - Configure
secrets.jsonif you want use discord webhook to log- If don't use, comment out its
addHandlerinsetup_serverfunction inLoggingStuff.py
- If don't use, comment out its
- Run
main.py
- Restart the server process:
- Immediately if it dies unexpectedly
- After a configured amount of time, with a warning sent:
- Been running for too long (process uptime limit)
- Leaked too much memory (process memory limit)
- Run the backup script:
- Every configured interval
- When the server dies
- Upload the backup data:
- When the server dies
NOTE: The server process does take more memory for the more users logged in simultaneously, does not neccessarily mean that it leaked memory. You will need to observe the resource usage a few times, and determine what should be the limits including your own device hardware specs in mind.
note: If the backup job is run due to interval, it will only upload the log file. Only when the server dies will it also upload the backup save data file.
- pipenv
- Python 3.12
- WinRAR executable
Rar.exefor save archiving - Discord webhook and a role id to ping
- Whatever version of the pate-trigger dedicated server files
- The two starters batch file
- One to start the server with recommended arguments
- Another one to configure save data archiving
- The upload of the save data archiving process log file and its resulting data file to webhook
- It is not cross-platform due to these problems:
- The signal sent to terminate the process gracefully is incompatible on Windows/Linux
- The starter batch files and archiving with
WinRAR
MIT
Feel free
There is an useless log file because I forgot to gitignore it the when I created the repo.