server performance on mysql connection accross other plugins
If I have multiple plugins(around 10) using the same MySQL database, will it perform better if they all ran in a single plugin since now only connects once to the same data server?
|
Re: server performance on mysql connection accross other plugins
why not just make one plugin that connects to the database and make the others send the info to that one?
|
Re: server performance on mysql connection accross other plugins
Yes, I think it would be smarter to have 1 plugin handle the queries.
However it could be a rather tiresome coding task if you have many plugins with a lot of functions and variables, to have them all communicate to a single plugin. Idk if the improvement would be that dramatic, but I noticed a long time ago when using the sqlx library on many plugins to save data on mapchange, even with threaded queries, it caused heavy lag/small crash everytime the map changed, making the loading screen like 4x longer. I solved this lag by hooking a function X seconds before mapchange to save players stats. I made some variation on each plugin when to execute the save so they don't all execute at once. This completely fixed the laggy loading screen when the map changed. If you do something like this you need to add a check on client_disconnect if the players stats are already saved, to not save them again. This of course may cause some "lost" stats, for example if you are tracking player kills, and a player kills someone during the last second after the save queries were already called, that kill would not be saved. But in my case it was well worth it to fix the lag/crash of the loading screen. |
Re: server performance on mysql connection accross other plugins
Quote:
|
Re: server performance on mysql connection accross other plugins
Quote:
|
| All times are GMT -4. The time now is 10:12. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.