Everything about Web and Network Monitoring

Home > Applications Monitoring > Database Monitoring > MySQL monitoring > It’s the Hardware, idiot! Increasing MySQL Performance

It’s the Hardware, idiot! Increasing MySQL Performance

MySQL performance can be increased in two ways, software optimization and hardware upgrades. While the previous articles have covered much of the software side of performance optimization, we are now going to focus on the hardware aspect.

Does hardware help boost performance?

Like software optimization, hardware upgrades for MySQL systems are based upon set goals for an organisation. The question is not what hardware would work best; rather a question of what hardware will help the organisation achieve an X goal.
The answer is yes, hardware does boost performance, but there are a few caveats to this. There are cases such as organizations’ demands are fulfilled even with crappy hardware, and all they require is a performance boost on the software side.
However, an organisation might have a goal plan for a major performance increase down the road, and even after all software tweaks, they only way to go up is by adding more hardware.

When not to upgrade Hardware?

“The first step in solving a problem is recognizing there is one.” This famous saying applies to a great extent in the case of hardware upgrades for performance boost.
Before any professional services are purchased, asking the following questions can solve the problems?
1. Hardware usage balanced: It might be the case that out of 4 servers being utilized for the database management, 3 of them are sitting idle while 1 server carries out the bulk of the workload.
So, rather than upgrading the hardware, it requires load balancing. This way, costs incurred by getting new hardware can be reduced considerably.
However, some applications cannot be easily balanced. At the end of the day, such decisions and trade offs are to be calculated by the IT department of the organisation. There isn’t any specific magic law that applies to every scenario.
2. Usage spikes: There is often a case of usage spikes, which usually happens during backup periods. This is a misleading indicator of hardware shortage. This can be simply resolved by evening out usage.
3. Software Optimization: The most important factor before deciding to even think about hardware optimization. Yes. You got it right. It’s software optimization. The organisation should ensure that their MySQL database system is well optimized for increased performance. This can be achieved by:
• Adding indexes
• Optimizing queries
• Database normalization
• Configuring MySQL server settings for the specific needs
• Benchmarking and stress testing the application regularly
4. The Goals: There is nothing such as better hardware; but the hardware that serves the application needs better. Like with software improvements, there are goals tied to reasons for hardware upgrades.
There aren’t any clear-cut answers for proving how hardware can improve the performance. There have been cases of upgrading from 4 cores to 8 cores and it reduced performance.
But the ultimate goal for improving application performance should be based upon the three factors: high throughput, better response times and smooth scalability. This can be obviously achieved by taking calculated decisions for example adding more memory to avoid disk IO and enable faster lookups in the database.

What hardware to upgrade to increase MySQL Performance?

Now that we have talked about when and why should hardware upgrades be an option, it is time to discuss which hardware upgrades are the most crucial.
It is natural to come to a conclusion that by adding more CPU, RAM and HDD, the MySQL performance will sky rocket all of a sudden. This, unarguably, is very true, at least on paper. However, the caveat lies in the understanding of technical specifications of carrying out hardware upgrades.
Here are a few important things to consider:
  • The number of HDD is more important than the space. This might seem shocking at first but there is a reason for that. There are cases of people adding 1 TB HDD and reducing performance.
    The trick is to get 4 x 250 GB HDDs with a RAID array. This helps the effective load distribution and increases performance greatly. Most top performing servers use RAID 10, which is safer and faster. This allows multiple queries to be balanced on multiple hard drives, giving faster response time, throughput and easier scalability.
  • Adding more RAM does help in terms of cache. However, the trick is to make the application utilize the added RAM. So there is a software tweak involved. This can be achieved by customizing the MySQL server configurations.
  • Adding more CPU depends on what type of application is being run. If the application is a number crunching, statistical application, yes adding more CPU power can affect the MySQL performance a great deal. If it were just a standard web/database server, then probably adding more HDDs would serve better.
  • Adding more servers is a key challenge, but a fruitful one if successful. For a large-scale application, a single server can’t obviously handle the entire load, so it is better off having two or more servers. So in the case of two servers, 50% of the traffic is routed to the other server, improving speed and balance load.
    The load balancing can be achieved by setting up the second server with dual-master replication. This technology keeps both the servers in sync and also serves as a backup system.
In conclusion, it can be said that hardware upgrades certainly increase MySQL performance to an extent. This might be a generalized statement because it is impossible to lie out a straightforward plan for improving the performance of a database at X organisation. This is because it is bound to be different than what is possible at Y organisation. Therefore, it is unto the organisation to set goals, gauge existing performance and perform extensive testing before upgrading.

About zhirayr

Web & Cloud
Monitoring