AppleDash / SaneEconomy

Finally, a sane economy plugin for Bukkit.
https://www.spigotmc.org/resources/saneeconomy-simple-but-featureful-economy.26223/
GNU General Public License v3.0
19 stars 24 forks source link

High TPS due to /balance. #25

Closed TrademarkTM closed 7 years ago

TrademarkTM commented 7 years ago

Hello guys. I was in my server and used /money pay. Obviously it doesn't work. But then it processed the command, and took about 2 seconds to send me that there's no account called "pay". But the problem is that it causes huge lag to tell me that.

Maybe just make it async? It freezes the server for a while, even if my database (flatfile) is totally clear.

Timings: http://prntscr.com/dhnvnc

AppleDash commented 7 years ago

Are you able to reproduce this more than once?

TrademarkTM commented 7 years ago

Everytime I use /money [username] the TPS drop occours. It have to be with a new username - e.g. random numbers/characters.

AppleDash commented 7 years ago

Thanks a bunch, looking into it now!

AppleDash commented 7 years ago

I can't reproduce this under a profiler. What other plugins are you running, and what version of SaneEco @TrademarkTM

TrademarkTM commented 7 years ago

Lastest version (downloaded today). http://prntscr.com/dhrc8e - my plugins

There are no scripts running. This is a local server, so the database has exactly one player (me).

AppleDash commented 7 years ago

I understand the issue - the issue is that whenever it tries to look up a player, it hits the Mojang API to try and figure out if that player actually exists, and retrieve their UUID and such. You have a slow Internet connection, so every API request takes a couple of seconds which freezes your server. I'll look into some way of making this work a bit better.

TrademarkTM commented 7 years ago

Yes, my internet is kinda poor. But shouldn't it be an async task? Some trolls may spam these commands with bots or something and lag my server, even if they're in a host.

AppleDash commented 7 years ago

Like I said, looking into it.

AppleDash commented 7 years ago

Expect an update that fixes this issue within a couple of days :)

AppleDash commented 7 years ago

Will be fixed in 0.10.0. Currently testing it, not yet released, but the plugin will notify you to update when it is!

TrademarkTM commented 7 years ago

Ok, thank you! You're an amazing developer.

MGAndreasen commented 7 years ago

Could we not just make an extra table in sql, with UUID, playername and revalidate the playername once per session or something, and then use that table for lookups, it will also make some of the sql easier i think.

update set = +10 where playername = ''

or simply with a uuid, playername table for fetching the player name or joining the tables together.

AppleDash commented 7 years ago

Try 0.10.1.