Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable or disable stacking based on MSPT hysteresis #290

Open
wants to merge 10 commits into
base: 5.10
Choose a base branch
from

Conversation

quiquelhappy
Copy link

@quiquelhappy quiquelhappy commented Jul 12, 2024

This pull request introduces a feature that enables stacking only when the server is under heavy load. When the server load decreases (due to hysteresis effects, meaning it has improved its initial threshold), stacking will be automatically disabled.

Key Points:

  • Load-Based Stacking: Stacking is activated during high server load and deactivated once the load drops below the threshold.
  • MSPT Providers: Supports both Paper and Spark as Mean Server Processing Time (MSPT) providers.
  • Default Setting: This feature is disabled by default and can be enabled through configuration.

Additional Changes:

  • Jobs Dependency Update: Updated the jobs dependency, as the author removed all GitHub releases except the one specified (this dependency uses JitPack).

@quiquelhappy
Copy link
Author

I applied all the mentioned changes. Thanks for the quick review.

@quiquelhappy
Copy link
Author

I've been testing this for a week so far on my server (https://minecraft-mp.com/server/323715/stats/) and I haven't seen any issues. The stacking does make a positive effect on the server with the current setup.

@ploppyperson ploppyperson self-assigned this Jul 20, 2024
@ploppyperson ploppyperson changed the base branch from master to 5.10 July 20, 2024 10:33
@@ -19,6 +19,23 @@ public MergeTask(StackMob sm) {
}

private void checkEntity(StackEntity original, boolean checkHasMoved, double checkHasMovedDistance) {
if(original.getEntityConfig().isMsptReactiveEnabled()){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it likely that this would need to be enabled/disabled on a per entity type basis? Because at the moment this is doing the check for each entity, when it could just be checked once at the beginning of the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only stack when the server is lagging.
2 participants