Excessive load caused by price-history-storage
Tibsfox opened this issue ยท 1 comments
git-Spigot-f6feaaa-3dc138d (MC: 1.9.2)
HyperConomy v0.975.7
This image shows the difference of having set price-history-storage enabled.
When enabled the query is called ~5 seconds:
SELECT OBJECT, PRICE FROM hyperconomy_history WHERE ECONOMY = 'default' ORDER BY TIME DESC
With many rows in the history this causes a lot of load on mySQL.
175152 row(s) returned 0.031 sec / 2.746 sec
If the query data is only needed for the web page it would make sense to call it only when the page is visited and cache it (and/or store it in the db), only updating periodically.
If no one is buying or selling anything than there really is no reason to be doing anything at all other than updating the price change percentage over time, and this doesn't need to be updated that often. Keeping the hourly percentage change updated every 5 mins or so (and again only if the web page is visited) seems reasonable. The rest could be updated once an hour or so and maintain 'close enough' tracking of changes.