MySQL-connections not closed
korhox opened this issue ยท 3 comments
Bug Report
Type /ver NametagEdit and post the output.
Please see console log: https://pastebin.com/MTiDBnPR
No errors.
What version of Bukkit/Spigot/PaperSpigot are you using? Type /ver
This server is running CraftBukkit version git-Spigot-4bd94dc-015bda4 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)
(currently latest)
What plugins are you using? Type /plugins
Only NametagEdit, for debug reasons.
Please explain your issue. How do you trigger it?
When connected to MySQL, plugin is opening several connections and not dropping them after used. Plugin leaves connections opened and my service operator limits simultaneous connections over 30. This limit is glogged up easily whith running 2 Minecraft servers at the same time.
Are there any errors in the console? Please use: https://pastebin.com
Please see console log: https://pastebin.com/MTiDBnPR
As you can see, no errors detected.
Best Regards,
Juuso "korho" Korhonen
This is not a bug, it is a function of the database pool. We create 10 connections which are closed only when the pool is closed. Database pooling software like HikariCP is far more efficient than single connections or maintaining our own house keeping.
I will add a configuration option that will permit you to change this. However, be forewarned that too few connections will cause pool instability and will compromise the plugin's database connection operations. I would recommend a minimum of 5 connections.
Then, I must say that we cannot use your plugin in the future. Connections are limited in our infrastructure and i cannot set them up, since our service provider limits them per client.
You should add support to 1 connection, witch checks database changes eg. every 10 minutes or configurable time. Since nametags are not so important, i think, this should be better solution for this. If rollback plugin is using 5-10 connections, this would be acceptable.
Think about this: all MySQL-plugins would be using this same pool system. What would be happen then? 50-100 connections to MySQL, witch is never a good option.
Thank you for your reply.