CraftConomy

154k Downloads

CPU Spiking & CraftConomy

Fluxty opened this issue ยท 3 comments

commented

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:
#95
#81
#63
#54

commented

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.

commented

@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?

commented

@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)