Batch file for anti crash detection and /restart support

Discussion in 'Performance Tweaking' started by ImNoDev, Jul 21, 2018.

  1. Hello, I was wondering if there was some batch file already out there that has some sort of parameters or some sort of method too...

    1. efficiently work with blocks being changed and just block updates in general.
    2. auto reboot on /restart
    3. anti crash detection so it reboots upon crash.
    4. anything else that will help increase performance on a windows 2016 server.

    My discord bots will inform me upon a server going down it just doesn't reboot the server. So it could be like 5 am for me and if the server crashes it means I will have to wake up to sort it out.

    RAM - 128Gb DDR4 ECC - 2400mhz
    CPU - 8 Cores / 16 Threads - 3.0Ghz / 3.5Ghz ( E5-1660v3 )
    SSD - 2x 450Gb SSD NVMe
    Network Card - 500Mbps - 1Gbps ( burst )

    If anyone can advise any plugin to help with performance in any way at all that would be amazing. I don't like being hand fed information so any wiki's on information reguarding performance within a batch file or in a java plugin that would be great.

    Thank you in advance <3
  2. ScarabCoder

    ScarabCoder Retired Resource Staff

    Usually that's why you'd use a panel like Multicraft or Pterodactyl. They have all those features, except the block updates thing. You can't make that more efficient with a batch file.

    EDIT: Are you sure you want to reboot on crash? You could easily get some corrupted data, especially if was caused by a plugin.
  3. Spigot already has support for running a shell script upon crash.
    • Informative Informative x 1
  4. I use an auto updater api and when it updates plugins in game by admins it forces the server to reboot. So it technically crashes it doesn't reboot it because some times it doesn't quite reboot properly. This is being worked on but for the most part it works. I just need to find the batch script @mrfloris is on about because I can't find it anywhere. I found a few .sh scripts but no .bat files.
  5. Oh sorry, I never use Windows for running a server/service.

    Any 'batch' of commands that help you to start your server can be used, be it a shell script, or windows batch file or whatever..

    There's yml files that come when you run Spigot for the first time that let you set the script to run on fail.
  6. I actually use a free 3rd party program to monitor my server. This guy Jimbobslimbob just creates these tools as he needs them and then offers them up to the web for free. Pretty cool.

    I discovered it while searching for an option to restart an unrelated game server (Space Engineers) whenever it decided to crash, and discovered it can also be used for Minecraft servers.

    Called Game Server Manager (GSM). Almost zero overhead and monitors your server in real-time. For Minecraft you simply have to copy your java executable (java.exe) to your server folder. Then, instead of using a BAT file to start your server, target the Java executable with GSM and use the "options" you would normally put in your BAT file as the command-line arguments in GSM.

    Works like a charm and has my server back up and running automatically in less than 15 seconds if it goes down for any reason (even if it freezes). You can also program in timed daily restarts, have it send timed commands to the server, etc. I found it pretty impressive for a free program.

    Edit: Just noticed he also has a Discord bot plugin for GSM. With the plugin you can send commands to GSM using your Discord server.
    #6 ViperZeroOne, Aug 5, 2018
    Last edited: Aug 5, 2018
  7. Code (Text):
    java -jar server.jar
    goto lbl