Closed SamB440 closed 3 years ago
Could you provide a spark profiling (for all threads)? That would be helpful to track down the issue.
That's an interesting observation.
I reworked this process recently in order to reduce the GC overhead. The currently present implementation of the SchematicCache can be found here: https://github.com/eldoriarpg/SchematicBrushReborn/blob/development/src/main/java/de/eldoria/schematicbrush/schematics/SchematicCache.java
I use a WatchService, which uses a notification based system in an own Thread. This may be the thread which is using one core probably. However this thread is waiting most of the time and not doing anything, so I am a bit curious what the cause here is.
I also observed the core usage on my windows machine and I can only identity 4 cores which show a behavior like you described, or at least a bit. However this is not a full used core and I dont know on which cores the threads of paper are running for other stuff.
I looked a bit around and found some sources, which note the existence of something called inotify-tools
which provides io notification events for the java application which resolved those high cpu issues. So it is maybe not directly related to the plugin but the OS itself. Maybe you can try it out and tell me if those tools are installed and if not if installing them resolves the issue.
https://stackoverflow.com/questions/24739280/watchservice-uses-100-of-cpu-on-centos
Could you provide a spark profiling (for all threads)? That would be helpful to track down the issue.
https://spark.lucko.me/8648EKkLBQ
I looked a bit around and found some sources, which note the existence of something called
inotify-tools
which provides io notification events for the java application which resolved those high cpu issues. So it is maybe not directly related to the plugin but the OS itself. Maybe you can try it out and tell me if those tools are installed and if not if installing them resolves the issue. https://stackoverflow.com/questions/24739280/watchservice-uses-100-of-cpu-on-centos
I will look into this in a few days time
Any news here? I am quite curious about this :D
We have since installed the inotify-tools, but haven't had the chance to install the plugin back again. We are currently updating to 1.17 as well.
Alright. I just released the 1.17 ready version of Schematic Brush. Please keep me updated on this ^^ Would be good to know when this issue arises again in the future.
Ok, I've installed this on one of my personal servers (which means this can also be reproduced elsewhere).
Using v1.4.3 and Tuinity 1.16.5 on Ubuntu 20.04.2, with a JDK 16 image with inotify-tools. Running using pterodactyl panel.
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)
With plugin, entire core almost always active:
Spark with plugin installed (--thread *, 60s): https://spark.lucko.me/3vh7Jl7HJV
We can see it in htop (103% cpu):
Without plugin, normal CPU usage:
Spark without plugin installed (--thread *, 60s): https://spark.lucko.me/Ld3Cax0wj2
Thanks for reaching me out again.
I have two good news. First I switched to linux for development and I can reproduce this on my linux system now. Second I found the issue and fixed it. The core utilization is now down to a few percent, where the most should not be related to the running minecraft server. I deployed the change in a snapshot. You can download it here. https://eldonexus.de/repository/maven-public/de/eldoria/schematicbrushreborn/1.4.4-SNAPSHOT/schematicbrushreborn-1.4.4-20210713.120217-1-all.jar
I can confirm that the new version fixes it
Glad that the issue is resolved now ^^ Thanks for contacting me ^^
Hi,
This plugin causes high CPU usage when installed (an entire core!).
Without SBR: With SBR:
This is CPU usage off the main server thread: And thus I believe the likely cause is this class here? https://github.com/eldoriarpg/SchematicBrushReborn/blob/master/src/main/java/de/eldoria/schematicbrush/schematics/SchematicCache.java
Server version:
Plugin version: 1.4.2a
Thanks!