Monitoring web apps with sharded mysql
I talked with Lew Cirne about New Relic, why monitoring is important, switching their data collector to java, and tweaking MySQL heavily.
* DISCLAIMER * New Relic is a sponsor of the show, but I believe their product plays a very important role in the devops space.
New Relic is a web application performance management company focused on providing runtime visibility of your web apps.
Unlike Scout or Fiveruns, New Relic is very easy to configure - all you need to do is just install the plug-in and it should be ready for your app.
New Relic is very specific about the platforms it supports - which is mainly Rails apps. It also has sacrificed customizability just to make the tool very simple and easy to use.
The company has a ‘contrib’ version on Github where people can put instrumentation from MongoDB or AWS APis that New Relic couldn’t cover in their library.
As new codes and platforms are emerging everyday, business demands are changing too. New Relic allows customers to responsibly take on the risks of this rapid change through various instrumentation.
New relic is basically a Rails app in the front end and a Java app in the back end. This multi-threaded network architecture provides extra efficiency and better performance. Multi-threading also allowed them to triple their traffic in the last year without adding any new hardware.
The company uses highly modified versions of Nginx and Haproxy for load distribution which stands in front of it’s Java app system.
As its data collection system, New Relic uses JDEE and it has Nginx in front of it.
According to Lew Cirne, New Relic’s secret for persistent data processing is nothing more than some optimized database sharding and good old fashioned MySQL. When New Relic first started, they had about 4-5 shards. The company now has 11 shards in production.
The New Relic team has it’s own custom sharding library. They did think about open sourcing the code but then finally decided not to as the code became more specific to their own requirements.
Lew Cirne thinks that New Relic cannot afford to experiment with Cassandra or other large scale NoSQL database systems as they are having to manage customers who are running serious businesses. So when it comes to data storage, they plan to only use proven technologies.
Whenever a new account is created at New Relic, a special algorithm is used to find out the least busy shard and then it is assigned to the new account for load balancing.
New Relic uses dedicated clustered architecture for their servers.
Lew Cirne thinks Dedicated servers are more suitable for New Relic’s app as EC2 just isn’t efficient for the way New Relic works.
According to him, Whether you need EC2 or a dedicated server depends solely on what your app does and what its requirements are.
The primary tool to keep the New Relic website running well is the New Relic app itself. And anytime when the app is not helping to solve a performance issue of the site, it just helps them to tweak the product and make it even better.
Lew Cirne says that RPM is very important for your apps and sites because it provides vital information and measurements for your product, which ultimately helps you to do the correct tweaking to make your product even better.
For most of the MySQL intensive shards and config issues, New Relic relies on the expertise of Percona.
New Relic has recently expanded into Java instrumentation.
While preparing for the Java instrumentation, they have created a interface where they can start supporting other platforms as well. So now they are thinking about supporting Sinatra, .NET and many other platforms.
The ultimate vision of New Relic is to provide an easy performance management solution for your web app regardless of its platform.
The pricing of the different packages of New Relic has always been an interesting issue and Lew Cirne dives into it. According to him - all the features that New Relic provides makes the price tag totally worth it.
If you are running a large scale web app, Instead of hundreds of manual engineer hours, an RPM gold plan from New Relic can actually save you hundreds of thousands of dollars.
For people with small scale apps and financial limitations, New Relic has a Lite RPM plan which is completely free.
The future plan of New Relic is to cover more and more platforms and become the primary tool for complete visibility in people’s web production.
New Relic already has started a BETA program for the .NET platform and by December 2010, they hope to launch several new platform coverages.