Help with performances
WarnDa opened this issue · 10 comments
Description
Luckperms is very heavy on my server, I can't determinate why ?
A plugin ? A problem with my config ?
Reproduction Steps
Expected Behaviour
Server Details
git-Airplane-12 (MC 1.16.5)
LuckPerms Version
v5.3.73
(as v5.3.74 didn't change anything for me)
Logs and Configs
Extra Details
- On both Mysql/Sqlite luckperms uses a lot of cpu !
- I tried on 1.12.2/1.16.5 java 11/java 16
- I got a dedicated machine, ping between server and database is 0ms, I'm using nvme SSD.
- Using latest dev build
- I got 30 ranks
- I got 100 online player and 3500 player in database.
- Each player get 50-150 permissions (it depends on player but common player get 100 permissions yes)
- online_mode
The spark :
https://spark.lucko.me/fkzO3tnDP2
It isn't 'that high'. LuckPerms does everything it can do off of the main thread, but even so with a lot of players and most likely a lot of plugins checking loads of permissions, things take a little bit of time.
If you can test this on a testing server after having removed all the plugin jars except Spark, and still get around 2% of the tick, please let us know. However, this seems entirely normal for that many online players and the scale of the operations to me.
Because it shouldn't be that high, so I got something wrong.
It would be way less, and I'm sure it comes from my config/or a plugin, because other people don't get the issue, so I'm expecting people to help me figuring what is the issue :)
Please try using LP v5.3.76 (https://luckperms.net/download)
I'd appreciate it if you could give it a try and run another spark? :)
Thanks !
I'll try this and send a spark tomorrow afternoon (a curent spark at 2am with 40 players is useless)
Hello,
Here is the new spark from today :
https://spark.lucko.me/GImQ7WcWW1
It's better, it can be a lot better, I don't know if it's my config or a plugin that make luckperms that high (most server, big or small, get less than 0.5% for luckperms in spark)
I've made some more improvements, please try using v5.3.77
Assuming you are not using DiscordSRV or EssentialsX contexts for any of your permission/group assignments, you could also improve performance significantly by disabling their context calculators. There should be an option for this in each of their config files. :)
e.g. add LuckPerms-Contexts
to DisabledPluginHooks
in the DiscordSRV config:
https://github.com/DiscordSRV/DiscordSRV/blob/master/src/main/resources/config/en.yml#L115
e.g. add LuckPerms-Contexts to DisabledPluginHooks in the DiscordSRV config:
https://github.com/DiscordSRV/DiscordSRV/blob/master/src/main/resources/config/en.yml#L115
Thanks I'll do this !
And I'll send a new spark using 5.3.77 tomorrow, thanks for your work :)
Now it runs pretty fine ! Thanks a lot
https://spark.lucko.me/zEPs6v7WKV
Also I tried to remove worldedit for fastasyncworldedit, as worldedit used 0.4% to check perms.
I'll try again tomorrow with worldedit.
Awesome, yea that seems to have reduced it a lot.
The remaining %s are mostly coming from the EssentialsX context calculators. You could open an issue there for them to track it - problem seems to be that ess.getUser is called repeatedly instead of just once.
I had a quick look but it's not a super strightforward fix without changing their current design.
Going to close this one for now :)