Blog

Sunday, November 06, 2011

Monitor SRCDS: Restart when it uses excess system resources and alert me

SRCDS when left running for extended periods of time will use more and more system resources, this is especially true for very poorly coded mods or when you have lots of plugins loaded. When this happens, your SRCDS server will start to lag really bad and your entire server computer will slow to a crawl. Daemon can solve this by monitoring and restarting SRCDS before it reaches these danger levels.

Reconfiguring the FireDaemon SRCDS Service

First you need to configure your SRCDS service to shutdown firedaemon if it crashes. The "Upon Program Exit" option in the "Settings" tab should set to: "Disabled" or "Shutdown FireDaemon".

FireDaemon Settings

Install and Configure daeMON

1. Download and install FireDaemon.

2. Download daeMON and unzip it into the directory of your choice (eg. C:\Program Files\daeMON).

3. Make a note of the short name of the SRCDS service you want to monitor (eg. srcds).

4. Start the FireDaemon Service Manager from the Start/Programs menu or desktop icon. Click on the Create A New Service Definition button in the Toolbar or press Ctrl+N. Fill out the panel as per the screen shot below (adjust your paths and parameters to suite) - you can use the TAB or SHIFT+TAB keys to move between fields:

Daemon Program Tab

The working directory is where you have placed the daeMON Perl script. Note the Parameters list. This is the list of services (in startup order) that you want to monitor. Each service short name is prefixed with a -s. If you want to change the monitoring facility frequency use the -f flag. The following settings are good in most cases: High CPU load threshold (as a percentage): 75 High memory threshold (in MB): 1024 Monitoring frequency (in seconds): 60 Ignore high CPU/Memory for X monitored intervals (in minutes): 5 [Look in readme.txt included with Daemon for more flags and descriptions]

5. You should really change the desktop interaction flag as it's not necessary to see what's going on (but you can leave it on if you are curious):

Daemon Settings Tab

6. If you want to capture the debug log output of the utility then you can enable it as per the Output Capture section in the screenshot below. If your services take quite a while to initialise then you can set the Pre-Launch delay (in the Process section). This will defer the startup of daeMON by the number of milliseconds you specify (5000 = 5s).

Daemon Advanced Tab

7. Alternately, you can make the daeMON dependent on the services it is monitoring. For example:

Daemon Dependencies Tab

8. Then click the Install button and daeMON should be installed and monitoring your group of services. Should you accidently shutdown a service or a process dies, then all the services that you specified in the Parameters list will be restarted. If you want to monitor multiple SRCDS servers, then you should create a new daeMON for each service rather than add another -s flag. The reason you should do this is because daeMON will restart every server if just one of them uses too much resources. Setting up a seperate daeMON for each SRCDS server will prevent this from happening. Don't worry about the CPU/Ram usage for having lots of daeMON services; one daeMON uses around 4MB of Ram and under 1% CPU. To find out how to receive email alerts when SRCDS restarts go here.

Comments
Post has no comments.



Captcha Image

Recent Posts



Tags


Archive

    Sign up for Product Updates and Discounts
    Captcha Image
    ×