Using new Relic's Free Server Monitoring
Why is New Relic important?
Due to some unrelated circumstances at work (and off the side), I haven't used New Relic for a while (3 years). I recently checked out their Server monitoring tier and discovered that it was distinct from their other offerings, such as APM, Insights Mobile, Browser, and others.
This isn't how I remembered it, but maybe the distinction was just in the area of marketing and messaging. The best part about the Server monitoring tieris that it's free!
When it comes to your web application, you'll get most value from New Relic with their paid services, I've found their free Server monitoring to be an instant life saver particularly when you're monitoring a large number of (70+) servers.
The free monitoring of servers is a lead-in to help your to decide to buy into paid products Naturally. It remains to be seen if this will remain free.
We utilize AWS to host paid hosting and customer trials at work. We have one server per application instance, as the main application is on-premise and not the multi-tenant database structure. This allows us to run multiple servers!
We've setup Cloudwatch with SNS for alarms and notifications but it's still difficult to use Cloudwatch to get an accurate overview of all the servers. To see what insights we could uncover we decided to try New Relic on a small subset of servers.
We were delighted to do this.
Install
The installation of the server monitoring daemon is easy, particularly because they provide instructions specific to your OS on a silver plate each time you add an additional server to their web console.
These instructions are for Ubuntu and Debian servers (only slightly modified for servers that don't run as user root).
The instructions will provide you with your license key. Do not blindly copy and paste the license key.
Configure
Technically, you don't need to do any additional configuration. However, I like to change one thing. The server name as shown in New Relic will match the host name of the server that you can locate by running the command hostname.
This might not be the way you want to identify the server, so you can either wait for the server to appear in New Relic, or configure the hostname prior to time in the New Relic configuration installed on your server. I've chosen the latter option.
Edit the /etc/newrelic/nrsysmond.cfg file and change the hostname section to whatever is appropriate for your server.
After making any changes, restart (or restart) the newrelic-sysmond services:
Without further effort you'll soon be able to see the server in your New Relic account under Server section.
What We Watch
This monitoring on New Relic isn't super advanced however, it has some really nice features:
Processes and the process count.
Note that PHP is a little out of control there and that's one of the things we were notified of, as the server has an over-use of CPU, which is above their default threshold of 15 minutes.
We immediately killed off a few PHP processes that were running in a state of zombie mode. We immediately saw CPU reduction back to normal levels.
We can have an in-depth overview of each type of process as well, sorting it by the amount of memory and cpu used:
Disk Usage
New Relic also sent out alerts regarding the usage of disks. One server had a lot of files taking up excessive space. We were able reduce the amount of disk space used by manually deleting any extra media files, which gave us the opportunity to add more hard drive space.