<p>When running any kind of server under load there are several resources that one would like to monitor to make sure that the server is healthy.  This is specifically true when testing the system under load.</p>

<p>Some examples for this would be CPU utilization, memory usage, and perhaps disk space.
What other resource should I be monitoring, and what tools are available to do so?</p>

[{'answer_id': 75020, 'author': 'GEOCHET', 'author_id': 5640, 'author_profile': 'https://Stackoverflow.com/users/5640', 'pm_score': -1, 'selected': False, 'text': '<p>I typically watch <code>top</code> and <code>tail -f /var/log/auth.log</code>.</p>\n'}, {'answer_id': 75024, 'author': 'Daniel Papasian', 'author_id': 7548, 'author_profile': 'https://Stackoverflow.com/users/7548', 'pm_score': 4, 'selected': True, 'text': "<p>As many as you can afford to, and can then graph/understand/look at the results.  Monitoring resources is useful for not only capacity planning, but anomaly detection, and anomaly detection significantly helps your ability to detect security events.</p>\n\n<p>You have a decent start with your basic graphs.  I'd want to also monitor the number of threads, number of connections, network I/O, disk I/O, page faults (arguably this is related to memory usage), context switches.</p>\n\n<p>I really like munin for graphing things related to hosts.</p>\n"}, {'answer_id': 75036, 'author': 'cori', 'author_id': 8151, 'author_profile': 'https://Stackoverflow.com/users/8151', 'pm_score': 0, 'selected': False, 'text': "<p>In addition to top and auth.log, I often look at mtop, and enable mysql's slowquerylog and watch mysqldumpslow.</p>\n\n<p>I also use Nagios to monitor CPU, Memory, and logged in users (on a VPS or dedicated server).  That last lets me know when someone other than me has logged in.</p>\n"}, {'answer_id': 75054, 'author': 'tante', 'author_id': 2065014, 'author_profile': 'https://Stackoverflow.com/users/2065014', 'pm_score': 1, 'selected': False, 'text': '<p>"df -h" to make sure that no partition runs full which can lead to all kinds of funky problems, watching the syslog is of course also useful, for that I recommend installing "logwatch" (<a href="http://www.logwatch.org/" rel="nofollow noreferrer" title="Logwatch">Logwatch Website</a>) on your server which sends you an email if weird things start showing up in your syslog.</p>\n'}, {'answer_id': 75776, 'author': 'pjz', 'author_id': 8002, 'author_profile': 'https://Stackoverflow.com/users/8002', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://www.cacti.net/" rel="nofollow noreferrer">Cacti</a> is a good web-based monitoring/graphing solution. Very complete, very easy to use, with a large userbase including many large Enterprise-level installations.</p>\n\n<p>If you want more \'alerting\' and less \'graphing\', check out <a href="http://www.nagios.org/" rel="nofollow noreferrer">nagios</a>.</p>\n\n<p>As for \'what to monitor\', you want to monitor systems at both the system and application level, so yes: network/memory/disk i/o, interrupts and such over the system level.  The application level gets more specific, so a webserver might measure hits/second, errors/second (non-200 responses), etc and a database might measure queries/second, average query fulfillment time, etc.</p>\n'}, {'answer_id': 77183, 'author': 'gbjbaanb', 'author_id': 13744, 'author_profile': 'https://Stackoverflow.com/users/13744', 'pm_score': 0, 'selected': False, 'text': '<p>network of course :) Use MRTG to get some nice bandwidth graphs, they\'re just pretty most of the time.. until a spammer finds a hole in your security and it suddenly increases.</p>\n\n<p>Nagios is good for alerting as mentioned, and is easy to get setup. You can then use the mrtg plugin to get alerts for your network traffic too.</p>\n\n<p>I also recommend ntop as it shows where your network traffic is going.</p>\n\n<p>A good link to get you going with Munin and Monit: <a href="http://www.howtoforge.com/server_monitoring_monit_munin" rel="nofollow noreferrer">link text</a></p>\n'}, {'answer_id': 82856, 'author': 'Jon Topper', 'author_id': 6945, 'author_profile': 'https://Stackoverflow.com/users/6945', 'pm_score': 2, 'selected': False, 'text': "<p>I use Zabbix extensively in production, which comes with a stack of useful defaults.  Some examples of the sorts of things we've configured it to monitor:</p>\n\n<ul>\n<li>Network usage</li>\n<li>CPU usage (% user,system,nice times)</li>\n<li>Load averages (1m, 5m, 15m)</li>\n<li>RAM usage (real, swap, shm)</li>\n<li>Disc throughput</li>\n<li>Active connections (by port number)</li>\n<li>Number of processes (by process type)</li>\n<li>Ping time from remote location</li>\n<li>Time to SSL certificate expiry</li>\n<li>MySQL internals (query cache usage, num temporary tables in RAM and on disc, etc)</li>\n</ul>\n\n<p>Anything you can monitor with Zabbix, you can also attach triggers to - so it can restart failed services; or page you to alert about problems.</p>\n\n<p>Collect the data now, before performance becomes an issue.  When it does, you'll be glad of the historical baselines, and the fact you'll be able to show what date and time problems started happening for when you need to hunt down and punish exactly which developer made bad changes :)</p>\n"}, {'answer_id': 87035, 'author': 'JBB', 'author_id': 12332, 'author_profile': 'https://Stackoverflow.com/users/12332', 'pm_score': 1, 'selected': False, 'text': "<p>Beware the afore-mentioned slowquerylog in mysql. It should only be used when trying to figure out why some queries are slow. It has the side-effect of making ALL your queries slow while it's enabled. :P It's intended for debugging, not logging. </p>\n\n<p>Think 'passive monitoring' whenever possible. For instance, sniff the network traffic rather than monitor it from your server -- have another machine watch the packets fly back and forth and record statistics about them.</p>\n\n<p>(By the way, that's one of my favorites -- if you watch connections being established and note when they end, you can find a lot of data about slow queries or slow anything else, without putting any load on the server you care about.)</p>\n"}, {'answer_id': 397922, 'author': 'oneself', 'author_id': 9435, 'author_profile': 'https://Stackoverflow.com/users/9435', 'pm_score': 2, 'selected': False, 'text': "<p>I ended up using dstat which is vmstat's nicer looking cousin.</p>\n\n<p>This will show most everything you need to know about a machine's health,\nincluding:</p>\n\n<ul>\n<li>CPU</li>\n<li>Disk</li>\n<li>Memory</li>\n<li>Network</li>\n<li>Swap</li>\n</ul>\n"}]
['https://Stackoverflow.com/questions/74993', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9435/']