[+] New launching flags test

This commit is contained in:
Charles Le Maux 2024-08-19 11:58:10 +02:00
parent 66d6483f46
commit 98c97964cc
2 changed files with 10 additions and 2 deletions

View File

@ -74,7 +74,6 @@ def fetch_logs(user: UserRecord, name: str) -> tuple[HTTPStatus, Union[str, None
try:
with open(log_file, "r") as f:
logs = f.readlines()[-lines_to_read:]
text_logs = f.read()
return HTTPStatus.OK, str(logs)
except FileNotFoundError:
return HTTPStatus.NOT_FOUND, "Log file not found."

View File

@ -21,7 +21,16 @@ class MinecraftServerManager:
if port in self.servers:
return None
command = f"{java_executable} -Xmx{memory_size} -Xms{memory_size} -jar {jar_file} --nogui > /dev/null"
reg_flags: str = ("-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200"
" -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch"
" -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M"
" -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4"
" -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90"
" -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem"
" -XX:MaxTenuringThreshold=1 -Daikars.new.flags=true"
" -Dusing.aikars.flags=https://mcutils.com")
command = f"{java_executable} -Xmx{memory_size} {reg_flags} -jar {jar_file} --nogui"
process = subprocess.Popen(shlex.split(command), cwd=server_directory, stdin=subprocess.PIPE)
self.servers_count = len(self.servers) + 1