ChangeSkin icon indicating copy to clipboard operation
ChangeSkin copied to clipboard

Local database for BungeeCord

Open ygtdmn opened this issue 6 years ago • 14 comments

My MySQL and BungeeCord servers are in different machines. For this reason when i use ChangeSkin with MySQL, my BungeeCord server lagging because of high network connection. So if you can add SQLite, H2 or YAML database to ChangeSkin it will be great.

ygtdmn avatar May 01 '18 13:05 ygtdmn

If the MySQL server is on the same network, you shouldn't notice any lags. Furthermore all SQL queries are processed async. For player logins it registers an intent to delay it until the query is finished (still async other plugins could run at the same time). So here you could maybe notice a delay.

If you're not on a game hoster, you can still install it on the same host too.

games647 avatar May 01 '18 15:05 games647

MySQL server and BungeeCord is not on the same network unfortunately.

ygtdmn avatar May 01 '18 15:05 ygtdmn

Could I ask why and if you are on a shared hoster?

games647 avatar May 01 '18 15:05 games647

My MySQL server is in dedicated with some spigot instances. And there is no place for any more server. BungeeCord is in another VPS.

ygtdmn avatar May 01 '18 17:05 ygtdmn

Then couldn't you run an MySQL instance on the BungeeCord server?

games647 avatar May 01 '18 17:05 games647

I don't want to setup another MySQL server :/ Also the VPS only enough for one bungeecord instance.

ygtdmn avatar May 01 '18 18:05 ygtdmn

Also the VPS only enough for one bungeecord instance.

Because of disk space, cpu, memory?

games647 avatar May 01 '18 18:05 games647

Yes

ygtdmn avatar May 01 '18 18:05 ygtdmn

Right now everything is fine. Cpu usage is %80, Memory usage %60, disk is almost not using. Only network is a problem.

ygtdmn avatar May 01 '18 18:05 ygtdmn

If you run MySQL/MariaDB on the same host, it will use the loopback interface. It won't make any networking traffic.

games647 avatar May 01 '18 18:05 games647

MySQL and ChangeSkin is not in the same host.

ygtdmn avatar May 01 '18 18:05 ygtdmn

MySQL and ChangeSkin is not in the same host.

I understood that the first time too, but I thought you answer is related to my previous post (https://github.com/games647/ChangeSkin/issues/138#issuecomment-385741909) and that you don't want host MySQL/MariaDB on the BungeeCord host, because of networking. Sorry for this misunderstanding.

I'm going to add the SQLite driver to ChangeSkin after some performance tests. For now you could do this:

https://gist.github.com/games647/d2a57abf90f707c0bd1107e432c580f3

(I know this isn't an optimal solution and is only temporarily)


Keep in mind that SQLite only supports single thread requests unlike MySQL/MariaDB that can handle parallel requests which is more optimal for BungeeCord environments with more players.

games647 avatar May 06 '18 11:05 games647

Thanks. This solves the problem.

ygtdmn avatar May 06 '18 12:05 ygtdmn

@games647 I made a plugin for this: https://www.spigotmc.org/resources/sqlite-for-bungeecord.57191/

It was hard to do that process at every BungeeCord update.

ygtdmn avatar May 26 '18 19:05 ygtdmn