celguar / spp-classics-cmangos

SPP Classics repack with ike3 playerbots. Based on cmangos. Supports 1.12, 2.4.3, 3.3.5. Check "Releases" for installer
210 stars 57 forks source link

Bots & Memory Usage (feature request) #165

Open sarge816 opened 1 year ago

sarge816 commented 1 year ago

When the server is left for an extended period online with bots active, memory usage continues to creep until it is completely used and the server crashes. Could we have a feature incorporated to easily restart the server on a schedule? Much like the restart already built into the menu if it crashes, but with the added ability to set a time/day etc. There may be a way to do this already but I haven't seen it. The built in server crash restart does NOT work when the server runs out of memory, as it simply creates a mangos reboot loop, and the sql database cannot be reached/errors. This can be easily reproduced by running a Vanilla server out of the box with 1000 bots and leaving it for awhile. Thanks for a great project.

Naylz commented 1 year ago

this has definitely to be pushed! either a restarter or a direct fix for the memory usage problem itself.

maybe you should post it in the correct section so they will fix it asap.

https://github.com/celguar/mangosbot-bots/issues

sarge816 commented 5 months ago

As an addendum to my initial post, a work around to get an automatic server restart can be had using the Windows Task Scheduler. I used this guide: https://www.addictivetips.com/windows-tips/terminate-close-an-app-on-schedule-on-windows-10/

1) You must be sure you set the server in auto restart mode ("T" on the main server menu).

2) The app you want to kill in the bat file is "mangosd.exe". No parenthesis, ofcourse.

I have our 24/7/365 LAN server running TBC set to restart daily at 5AM. Works fine.

celguar commented 5 months ago

what expansion do you have memory leaks in?

celguar commented 5 months ago

ah it's TBC...how much does it grow over period of time?

sarge816 commented 5 months ago

@celguar It depends upon the number of bots running. If the server has no bots, it runs like a top and doesn't look to have any issues at all so I'm guessing it's bots. If I leave the server running for several days, it can approach my 16GB RAM and things get pretty laggy. That was a bit ago though, as I've been restarting it every few days. With the Scheduler trick above, the server gets restarted daily so it isn't an issue. Not sure how difficult it would be, but to have an automated server function that would start an in-world count down (like when you restart server as admin) and then shut off would be great. This may not be an issue for most people, as we run the server 24/7 on a dedicated box.