divios / DailyShop

Spigot plugin. Fully configurable shop with daily offers. NBT & multi-currency support and more!
https://www.spigotmc.org/resources/daily-shop-free-random-items-shop-customizable-items-timer-nbt-support-and-more.86907/
29 stars 15 forks source link

CPU usage 0_0 #119

Closed yellow-pillow closed 2 years ago

yellow-pillow commented 2 years ago

Ooooh, you want a gimmick? again, huge and endless CPU consumption (using the latest version of the plugin)

BUT it happens only in a certain case - when you open the logs of the plugin, and more precisely the sales logs

in general, I almost crashed my server just opening the logs, most likely due to the fact that on my server a lot of things sell and logs a lot and when you open them the server starts creating all the log pages and at this point, as it hangs + after loading all the pages and if I looked at them for example and left (and I was just in shock and stopped wanting to do it)

in general after closing the logs load from the processor does not disappear, and continues to stress it very much (I helped just restart the plugin /rdshop restart )

i thought for a long time that logs would blow up my server, but on old versions i had problems with logs in general, they did not work (just updated today)

maybe i should unload all menus from their server load? i don't really understand how this works, but i can assume that if the server keeps in its CPU all the logs menus then it may keep all the stores menus (maybe with time to unload them?)

Tell me what you think, I am interested))

divios commented 2 years ago

Mmm that's rare, even if the the "creating log" message appears, in reality the pages are being created in an async thread, and when that is finished, it will be displayed to you. So there should not be any stress on the cpu whatsoever, even if it appears to crash the server.

Although I have not tested this with lots of entries on the database, could you send me your db file? I want to test it with that

yellow-pillow commented 2 years ago

yes, I wanted to attach it, but I forgot, now I’ll finish my tea and send it

yellow-pillow commented 2 years ago

Well I'll tell you that my CPU load was 70% +- (out of 600 because there are 6 cores) and when I looked at the logs it was 400%

https://drive.google.com/file/d/1THoNOZfaAgF6f92XnyQ8MFEs7IsTtu0f/view?usp=sharing

divios commented 2 years ago

Could you try this build? It limits how many entries are displayed into the gui.

It also comes with an option in the settings to delete old entries in the database. By default entries older than 20 days are deleted

yellow-pillow commented 2 years ago

i'll try

divios commented 2 years ago

Did you try it?

yellow-pillow commented 2 years ago

Man, I'm sorry, in fact, I'm even embarrassed that I'm so long:(

A lot of things on the server, trying to expand that would be more players:)

as for the performance I did not notice a big difference (judging by the eye on the load graph)

At the moment I do not use this feature so not very critical it is for me