.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Enhancement Workshop > (mEAn) Bot.Admin Mod / ServerLoader > (mEAn) ServerLoader > General Forum - ServerLoader
General Forum - ServerLoader Post your questions, comments, solutions and suggestions for the ServerLoader in here

Reply
 
Thread Tools
Detecting programs caught in an endless loop.
Old
  (#1)
Drek
Member
 
Status: Offline
Posts: 64
Join Date: Feb 2004
Default Detecting programs caught in an endless loop. - 19-06-2005

I'm having a problem with one of my servers locking up, and I think what is happening is that it is getting stuck in an endless loop. CPU load is close to 100% and there are no error logs generated, and obviously ServerLoader doesn't detect the problem and restart the server.

This led me to think about possible ways that ServerLoader might detect this and restart the server if this occurs. Would it be possible for ServerLoader to monitor CPU load? If it could do this then what it could do is if CPU load stays at X% for Y number of queries, it would shut the server down and restart it. It would have to use the shutdown methods you talked about in the other thread about locked up servers, because shutting down a looping program can be difficult.

X and Y could be configurable, so, for example, I could set it that if CPU load stays above 96% for 10 queries in a row, ServerLoader will shut the server down and restart it. Chances are if the server is experiencing that kind of load for that long, there is some kind of problem, so a restart is probably definitely in order, even if the server isn't technically caught in a loop.

This kind of protection could be extended to detecting problems with memory leaks. If memory usage climbs above XMB for Y queries in a row, the server will shut down and restart. So I could configure it that if memory usage climbs above 256MB for 10 queries in a row, the server will shut down and restart.

Don't know how difficult these things would be to code, but they would certainly be useful I think. (Easy for me to make suggestions when someone else is doing the work. )
  
Reply With Quote
Re: Detecting programs caught in an endless loop.
Old
  (#2)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: Detecting programs caught in an endless loop. - 22-06-2005

These are all good ideas and I'll look into them when I can. Detecting CPU usage and so on may be relatively easy if there's a Windows API function for it.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: Detecting programs caught in an endless loop.
Old
  (#3)
Drek
Member
 
Status: Offline
Posts: 64
Join Date: Feb 2004
Default Re: Detecting programs caught in an endless loop. - 22-06-2005

Quote:
Detecting CPU usage and so on may be relatively easy if there's a Windows API function for it.
I'm guessing, in my own uneducated way, that there is such a thing (probably what the task manager uses). The same probably applies to memory usage, although it is probably in KB instead of MB, but translating it would probably be a good thing as MB would be more user friendly.

Last edited by Drek; 22-06-2005 at 15:31..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com