MySQL when left running for extended periods of time can use more and more system resources, this is especially true for very busy websites where the usage can become so extreme that all the RAM is used and CPU usage hits 100%. When this happens, your website will fail to load and your entire server may lock up. daeMON can solve this by monitoring and restarting MySQL before it reaches these danger levels.
Reconfiguring the FireDaemon Pro MySQL Service
Assuming you are running MySQL under FireDaemon Pro, first you need to configure your MySQL service to shutdown FireDaemon Pro if it crashes. The "Upon Program Exit" option in the "Settings" tab should set to "Ignore" or "Shutdown FireDaemon".
Install and Configure daeMON
- Download and install the latest version of FireDaemon Pro.
- Download daeMON and unzip it into the directory of your choice (eg. C:\Program Files\daeMON).
- Make a note of the short name of the MySQL service you want to monitor (eg. mysql).
- Start the FireDaemon Pro Service Manager from the Start/Programs menu or desktop icon. Click on the Create A New Service Definition button in the Toolbar (+ sign) 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:
The working directory is where you have placed the daeMON. 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
- 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):
- 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:
- Alternately, you can make the daeMON dependent on the services it is monitoring. For example:
Then click the Install (tick) button and daeMON should be installed and monitoring servics. Should you accidently shutdown a service or a process dies, then all the services that you specified in the Parameters list will be restarted. To find out how to receive email alerts when MySQL restarts go here.