I decided that I wanted to put some monitoring on the server for items such as CPU, Memory, Disk and Network usage. I had a look around and there are a number of different products that I could of used such as collectd, Nagios and various others based on RRD data collection, after looking at a number of them they all seems to offer different things. I then found New Relic when I was looking at the load testing tools that were available. New Relic offers a full server monitoring solution with a really nice interface and lots of different plugins for various products like MySql, Memcached, Varnish, various other database and a number of other products. One of the other parts that it offers is the ability to see the Web transactions, database calls and from where they are coming and many other features.
This service is free for the basic monitoring level which does offer a lot already. Have a look at New Relic it is pretty easy to install and configure, you can be up and running in no time at all.
The following is server overview, you can change the range of data that is shown as well so if you just want to see how it is doing now, just set it to 30 minutes, if you want to see what it has been doing over the last week change it to a week. As you can see this is showing that I’ve run out of memory so probably a good idea to increase that at some point.
You can then drill down into any of the components and see additional details, so from the memory problem that I have I can go into the process view and see which process are taking up all the memory. So as you can see from the following php5-fpm is clearly using most of the memory so I should look at tuning that so that it uses a little less memory if I didn’t want to expand the memory on the server. An Update since writing this, I’ve gone back and looked at the configuration of php5-fpm and done a little tuning, and now my memory of the process has been reduced dramatically. The following are the settings that I’m now using:
- pm = dynamic
- pm.max_children = 10
- pm.start_servers = 2
- pm.min_spare_servers = 2
- pm.max_spare_servers = 5
- pm.max_requests = 50
The application monitoring part of the tools is loaded up as part of Nginx or Apache if you are using that. This allows it to be able to get a large number of different monitoring data points and allows you to drill down into the data that has been collected. So if you are having a problem with a slow loading page then you can drill down and see what is holding up the page load. The following is the overview.
Then drilling down further into the database layer of WordPress you can see the queries that are going on, then each of these you can then drill down further into it. If you then have a slow transaction you can then go down into a stack trace to see exactly where it came from.
So if you get a chance go check out New Relic and give it a go. Once of the best free services that I have found, highly recommended.