gringotts icon indicating copy to clipboard operation
gringotts copied to clipboard

After the update Towny Gringotts lags on the server.

Open Darutan92 opened this issue 3 years ago • 14 comments

Hi. After in the spring of 2020 you released an updated version of the plugin (Gringotts 2.11.2-SNAPSHOT-rf77e523), there were no problems, everything worked fine on 1.15.2 and 1.16.5 with all versions of Towny until recently.

But recently I have updated Towny from version 0.96.7.4 to the latest currently 0.97.2.0. And after that, Gringotts began to load the server heavily. The other day you updated Gringotts to 2.12.1, I installed it in the hope that it would help fix the situation, but no.

Why can this be so? It all started after updating Towny from version 0.96.7.4 to 0.97.2.0, before that there were no problems. M8B0Dm0A5QY 4wMi5ioiCsQ

Darutan92 avatar Nov 16 '21 21:11 Darutan92

Hello @Darutan92 , that is really interesting.

I go through the change-list from version 0.96.7.4 to 0.97.2.0 of Towny and I couldn't find something that could cause slowdowns on Gringotts. It's actually Gringotts slowing down Towny rather than Towny slowing down Gringotts.

Of my understanding it has to do with the database. Is taking more that x time to extract data from the database. What kind of database are you using? Are you using a "portable" database like sqlite, h2 or a server like database, for example mysql or mariadb?

F.Y.I. @LlmDl

nikosgram avatar Nov 17 '21 13:11 nikosgram

It might be that you're making an OfflinePlayer out of the town/nation name passed by Towny through Vault?

As an aside I'm currently trying to get a PR accepted by Vault which would get OfflinePlayers out of the Economy entirely, in favour of UUIDs. This sort of thing might interest you: https://github.com/MilkBowl/VaultAPI/pull/112

LlmDl avatar Nov 17 '21 14:11 LlmDl

I think I figure out the issue :) Working on it.

nikosgram avatar Nov 17 '21 21:11 nikosgram

Hello @Darutan92

Can you try the same with the following version of Gringotts?

https://github.com/nikosgram/Gringotts/releases/download/2.12.2-SNAPSHOT/gringotts-2.12.2-SNAPSHOT.jar

In theory, the problem should be fixed, but, I'll keep the ticket opened until you verify that the problem got fixed :)

P.S. this is a pre-release version. Please backup your server before using it.

Thanks.

nikosgram avatar Nov 17 '21 21:11 nikosgram

Hello @Darutan92

Can you try the same with the following version of Gringotts?

https://github.com/nikosgram/Gringotts/releases/download/2.12.2-SNAPSHOT/gringotts-2.12.2-SNAPSHOT.jar

In theory, the problem should be fixed, but, I'll keep the ticket opened until to verify that the problem got fixed :)

P.S. this is a pre-release version. Please backup your server before using it.

Thanks.

I'll just tell you what I did yesterday. I installed the latest preliminary version of Towny 0.97.2.18 and Java 17 - after that the error in the console, which is in the second screenshot, passed. But the increased load on the server remained.

Towny's files are stored in yaml - flatfile.

Now I will install your version of Gringotts, I will be able to report the effect only after about 24 hours, now there is little online on the server and there was a restart - and the lags are going upward over time. Therefore, it takes time to understand whether it helped. I will definitely write later!

Darutan92 avatar Nov 17 '21 22:11 Darutan92

Unfortunately, we did not notice much of a difference. 7WhNzh5TqA0

Darutan92 avatar Nov 18 '21 14:11 Darutan92

Although the above is red, it did do 1210 of them in just 7.335 seconds. What was your timings duration for that screenshot?

LlmDl avatar Nov 18 '21 14:11 LlmDl

Although the above is red, it did do 1210 of them in just 7.335 seconds. What was your timings duration for that screenshot?

These are 1 hour timings.

Darutan92 avatar Nov 18 '21 15:11 Darutan92

Hmm, that might be the bstats telemetry gathering. I'll provide you with an option to disable it until I found a way to make it faster. :) Working on it

nikosgram avatar Nov 18 '21 21:11 nikosgram

@Darutan92 can you try this version?

https://github.com/nikosgram/Gringotts/releases/download/2.12.2-SNAPSHOT-R0.2/gringotts-2.12.2-SNAPSHOT-R0.2.jar

By default, gathering total server balance and vaults for bstats will be disabled. Though, dependencies and denominations are still being part of the telemetry report, as the process of gathering that kind of data is not a heavy one :)

Please let me know if you still having the same issue. :) Thanks.

nikosgram avatar Nov 18 '21 21:11 nikosgram

Sorry for the delay, couldn't reply earlier.

After your first snapshot, the server's mspt got better. But, as I said, the red ticks remained.

The second snapshot did not really change the situation, the ticks became smaller, but there is still a delay.

My programmer suggested that it would be a good idea to handle balances asynchronously.

image

Darutan92 avatar Nov 20 '21 21:11 Darutan92

Damn, accidentally pressed ... image

Darutan92 avatar Nov 20 '21 21:11 Darutan92

Hello :)

It took me forever to reply, though, that was because I had almost no free time the last few months.

I implemented some changes that should help with the lag spikes.

gringotts-2.12.3.jar.zip

Is it possible to give it a try with the attached version of gringotts?

nikosgram avatar Mar 16 '22 00:03 nikosgram

Hello. It is OK, it happens. I hope you are fine. Unfortunately, I don't have the opportunity to test the plugin right now, as my server is being reworked and frozen until the new summer season.

Darutan92 avatar Mar 17 '22 09:03 Darutan92

This issue is why I didn't go with Gringotts this last time. I would love to get rid of a virtual economy, but it's so slow with Towny. I would be happy to help test things out if there's any test server set up. I might even set one up if necessary, and whitelist those who want to join it. A good testbed is necessary for better bug reports.

roracle avatar Feb 28 '23 03:02 roracle

@roracle my server decided to use Gringotts with Towny some time ago and we faced the same issues. However I did two PRs (#114 & #124) which greatly reduced the lag making it imperceptible, recently we hit around 35 active towns and the lag started coming back again (it is still far less than at the beginning though). If you don't have more than that amount of towns you shouldn't experience lag. I will try to further improve the performances in the coming days, also take into consideration that the lag caused by Gringotts is now mainly storage bound so it will depend n the quality of your hard drive/ssd/nvme.

GroobleDierne avatar Mar 13 '23 22:03 GroobleDierne

@roracle my server decided to use Gringotts with Towny some time ago and we faced the same issues. However I did two PRs (#114 & #124) which greatly reduced the lag making it imperceptible, recently we hit around 35 active towns and the lag started coming back again (it is still far less than at the beginning though). If you don't have more than that amount of towns you shouldn't experience lag. I will try to further improve the performances in the coming days, also take into consideration that the lag caused by Gringotts is now mainly storage bound so it will depend n the quality of your hard drive/ssd/nvme.

I think at this point I've landed on TNE as the economy system on my server since it can do virtual and physical together, making Towny easier to work with.

roracle avatar Jul 24 '23 13:07 roracle