craftconomy3 icon indicating copy to clipboard operation
craftconomy3 copied to clipboard

CPU Spiking & CraftConomy

Open Fluxty opened this issue 8 years ago • 3 comments

Plugin could maybe benefit from caching methods, causes massive lag spikes on populous servers. Thanks <3

http://i.imgur.com/62EGwvZ.png

http://i.imgur.com/IT5EZYx.png

Related issues: https://github.com/greatman/craftconomy3/issues/95 https://github.com/greatman/craftconomy3/issues/81 https://github.com/greatman/craftconomy3/issues/63 https://github.com/greatman/craftconomy3/issues/54

Fluxty avatar Nov 29 '16 07:11 Fluxty

Implementing caching with an economy plugin that is supposed to not have any exploits is really difficult to do, especially in a time where you want economies to work on multiple servers connected to a Bungee network without balances desyncing.

My suggestion to you would be to put a faster database behind it.

Phoenix616 avatar Dec 07 '16 20:12 Phoenix616

@Phoenix616 In relation to a recent crash of our JVM:

"net.brcdev.shopgui" is using Vault to check the balance of a player in the main thread. Craftconomy3 ("com.greatmancode.craftconomy3") performs a database query in the main thread in response to the Vault API request.

I'd say Craftconomy is at fault for doing database queries in the main thread, it should cache player balances in memory.

EDIT: I do not use the DB to sync money across our network. Each server uses a separate DB. Optional caching?

Fluxty avatar Dec 21 '16 05:12 Fluxty

@Fluxty Yeah, optional caching would be one way to work around a slow database. If the only queries that you are worried about happen very often and are only balance checks you could even let your database cache the result by itself.

Another one would be for plugins to not access an economy plugin on the main thread. (That could result in new desync-issues 'though as two threads might access the same account at the same time)

Phoenix616 avatar Dec 21 '16 20:12 Phoenix616