authme is doing MySQL on server thread
Opened this issue · 9 comments
Before reporting an issue make sure you are running the latest build of the plugin and checked for duplicate issues!
What behaviour is observed:
What happened?
huge lag every join
What behaviour is expected:
What did you expect?
I expect authme to do MySQL connections on separate thread, yet it does it in main while useAsyncTasks is true
Steps/models to reproduce:
The actions that cause the issue
Plugin list:
This can be found by running /pl
Environment description
Standalone server/Bungeecord network, SQLite/MySql, ...
bungeecord, mysql
AuthMe build number:
This can be found by running /authme version
2385
Error Log:
Pastebin/Hastebin/Gist link of the error log or stacktrace (if any)
Configuration:
Pastebin/Hastebin/Gist link of your config.yml file (remember to delete any sensitive data)
Well you can see at the log that's not AuthMe running on the server thread. It's
[21:07:59] [Paper Watchdog Thread/ERROR]: com.kirelcodes.miniaturepets.pets.Pet.(Pet.java:153)
If you mean this message:
[21:07:58] [AuthMeMYSQLPool connection adder/INFO]: [NetworkInterceptor] Intercepted outgoing connection to host '51.83.99.210'
That's normal, but there is no information that this is on the main thread.
EDIT: You can follow the stacktrace.
- Skript running an effect task.
- JavaScript user defined action is performed.
- Bukkit command is executed
- MinaturePets handles the command and performs database action.
However AuthMe could have trigger those actions after the user logged in, because AuthMe releases the player.
It should already do that. Do you have any stacktraces or errors that highlight this behavior?
The error is about MinaturePets
is waiting for incoming data from the SQL server. There you can see that MinaturePets
is doing SQL operations on the main thread, that should be performed asynchronous. This could affect performance. (Your title)
However you can also see that the server thread doesn't continue or there multiple tasks queued that all execute this code that will hold at the same position. AuthMe
freezes the player if not logged it. This could cause Skript to queue too many effects and therefore they all report the same stacktrace. Similar there could be a loop inside MiniaturePets
The server thread freeze could also happen if there is a deadlock on the SQL server, another connection is not allowed or the MySQL/MariaDB server is overloaded. AuthMe
also establishes MySQL/MariaDB connection. So please check the CPU usage and MySQL/MariaDB server settings (not the plugin settings).
Furthermore you could also try one run without MinaturePets
or Skript
with AuthMe
enabled and observe the log and timings report. Remember Correlation does not imply causation. It's also useful in this case to post the configuration of AuthMe
and your Skript
plugin to debug it.
In summary (in this order):
- Please test one run without
MinaturePets
- Same without
Skript
but with the other two plugins - Check the MySQL/MariaDB server settings
Okay found it. Caching is required here. What is your motivation for disabling it?
That's looks like a big design flaw in our system. I'll open another ticket for discussion. Looks like you found something critical. Thank you.
For now you could disable inventory protection. This should reduce the amount of calls drastically in case the player is not logged or registered and something changed in the inventory.
Might add aswell, noticed there is lag upon some players joining, and noticed there is a nice lagspike when new players join my Network. Re-occuring players dont seem to cause too much of a a lagspike but when a brand new player joins, there is a noticeable lagspike.