Professional Documents
Culture Documents
Part 2
Introduction ................................................................................................................ 3
The Busy MySQL DBA .............................................................................................. 3
The Impact on Your Business .................................................................................. 3
The Common but Deadly MySQL Problems ................................................................ 4
Poor Migration Preparation .................................................................................... 4
Upgrades ............................................................................................................. 4
Capacity Alterations ............................................................................................ 5
Moving Operations Into or Out of the Cloud ...................................................... 5
Changing Products .............................................................................................. 6
Poor Query Performance ........................................................................................ 7
Lack of High Availability/Too Much Downtime ....................................................... 8
How Percona Can Help.............................................................................................. 10
About Percona .......................................................................................................... 11
The first white paper in this series covers Out of Date MySQL Versions, Inadequate
MySQL Configuration Settings, and Unmindful Deployment Practices and can be
downloaded from the Percona website.
The information in this series of white papers is based on collected advice from the
Percona Support, Consulting, and Managed Services teams. These teams include experts
in MySQL operations who have helped thousands of clients over the past eight years.
You may be filling the role of your organization’s MySQL DBA because there is
no one else available. You may have limited DBA experience and might be an IT
professional, a SysAdmin, the CTO, or on the Engineering staff.
You may be a DBA by profession but be overloaded due to lack of resources in
your organization. Your time might be divided between database operations
and other tasks such as application development. You may be addressing issues
reactively or when time allows, hopefully before disaster strikes.
You may be a DBA transitioning into a more strategic role in which the handling
of common operational tasks is no longer your main focus or desire. In this
capacity, common but necessary database administrative tasks are performed
ad hoc, as time allows, or perhaps not at all.
Unacceptable downtime
Unnecessary costs
Percona can help. Percona Consulting and Support services for MySQL offer customized
help and immediate assistance from MySQL experts. Percona Managed Services for
MySQL can take over your organization’s MySQL operational tasks, letting you
concentrate on other projects.
Upgrades
Upgrading an operating system or MySQL version might require a primary master
to be taken offline. An upgrade can be facilitated by promoting a slave to take over
the primary master’s role for the duration of the upgrade. However, this method
requires careful planning and knowledge of potential problems. In some cases,
erroneous writes can be made to the demoted master resulting in data integrity
issues. Replication reconfiguration mistakes can result in missing transactions or
data consistency issues. Both of these potential pitfalls cost organizations extra
time and effort to manually solve the problems introduced in the upgrade.
When preparing for an upgrade in this manner, there are several things you can do
to minimize disruption. First, make sure that you isolate the node from potential
connection sources. You will need to work with the team responsible for the
application to ensure that threads are not being created on the host that is
The integrity of the data on the slave must be trusted when moving the read/write
role to an asynchronous slave because there is no guarantee from MySQL that all
events have been replayed on the slave. The best way to achieve this is to use the
Percona Toolkit tool pt-table-checksum regularly and action the sync of any
detected differences with pt-table-sync. It is a best practice to make a backup of
the data before executing the upgrade so you have a rollback plan. To further
reduce the margin for error, we recommend that a detailed action plan is produced
and peer reviewed to make sure nothing is missed.
Capacity Alterations
You may need to take a server offline to perform hardware maintenance such as
fitting memory. There are also cases where your primary master may be on
hardware over-specified for its workload and you want to reduce its capacity.
Minimizing downtime through the use of High Availability tools can reduce or even
remove the need to take you application offline while work is performed.
For Percona, Master High Availability (MHA) with MySQL replication allows us to
automate the practice of relocating a Virtual IP address and reconfiguring slave
replication coordinates from manual atomic individual tasks to a smart and swift
process. The technique has permitted us to grow block storage by terabytes
without end users noticing any service interruptions. We recently diagnosed that a
client had over specified their hardware and were paying for expensive high
performance storage capable of many times the required throughput. Through the
user of Percona’s HA toolset, we were able to clone the master and migrate
without suffering any outages. In the end, we significantly reduced our customer’s
total cost for their overall system.
Changing Products
Some organizations migrate from one variant of MySQL to another to make use of
functionality that does not exist in their current variant. Taking time to plan and
identify the issues which may result in downtime can highlight where
measurements need to be made to minimize disruptions to daily workflow.
If you take the database offline while making changes, operations may be
interrupted. Percona has developed techniques to minimize or eradicate downtime
over many years of implementing migrations for clients. In many cases, Percona
uses the MHA software package to simply and safely move the role of master to a
waiting slave host. This provides the agility to failover to a machine that has had
upgrades applied or that has been built in the new datacenter.
There are several Percona resources on the Percona website that you can use to
help better prepare for a migration including:
A good index on a simple select can be the difference between response times
measured in minutes or milliseconds. For most of our clients experiencing excessive
server loads or slow MySQL, the root cause is a poor performing query or queries
which can be easily fixed with the correct indexes or by rewriting the query.
We have improved response times, reduced server load and improved scalability
with our query optimization services. This allows our clients to serve more
concurrent users without affecting performance.
The first step before making any changes to your application is measuring your
query performance. Percona uses tools like pt-query-digest to identify the worst
performing queries and quantify the results of a change. We also use Percona
Cloud Tools to monitor how the worst performing queries might change
throughout the day and especially when new code is deployed.
There are several Percona resources on www.percona.com that can help improve
your query performance including:
eBook: MySQL Query Optimization, by Percona CEO Peter Zaitsev, CTO Vadim
Tkachenko, and Software Engineer Muhammad Irfan
eBook: MySQL Logs, by Percona CEO Peter Zaitsev, Principal Architect Peter
Boros, Sr Knowledge Manager Bill Karwin, and Software Engineer Aleksandr
Kuzminsky
Webinar: Advanced Query Tuning in MySQL 5.6 and Beyond given by Percona
Principal Architect Alexander Rubin
Webinar: Practical MySQL Performance Optimization given by Percona CEO
Peter Zaitsev
Webinar: MySQL Query Patterns, Optimized given by Sr Knowledge Manager,
Percona Support Team, Bill Karwin
Webinar: MySQL 5.6 Indexing: Best Practices given by Percona CEO Peter
Zaitsev
There are many high availability options available. The right solution depends on
your application’s unique needs. For example, a Percona client in the retail industry
had implemented Percona XtraDB Cluster with HAProxy and came to Percona for
help with poor availability. We analyzed their environment and found that their
approach was not a match for the workload of their application. In their case, large
transactions were affecting the availability of the cluster. We helped migrate them
to a solution based on native MySQL replication, MHA, and AWS EIP failover. The
result was an improvement in availability and a simple failover that suited their
application’s workload.
Finding a high availability solution that is right for your business requires in-depth
knowledge of the options. We recommend working with an experienced team that
understands the choices, how to assess which is suitable for your situation, and can
provide guidance on implementation matters.
There are several Percona resources on www.percona.com that you can use to
increase availability and reduce downtime:
Keeping abreast of best practices for preventing these dangers takes time and expertise.
If you are a busy MySQL DBA and you worry about the level of attention being given to
your databases, Percona can help.
Percona Support services are accessible 24x7 online or by phone to ensure your MySQL
is running optimally. We can also provide onsite or remote Percona Consulting for
current or planned projects, or in emergency situations. Every engagement is unique
and we will work with you to create the most effective solution for your business.
If you lack the resources to adequately manage your MySQL operations, you can
outsource full operations of your MySQL servers to Percona Managed Services. Percona
offers both outsourced database administration and backup and recovery services.
Organizations that rely on Percona Managed Services benefit from our deep
operational expertise, 24x7x365 coverage from our worldwide team of experts, SLA
commitments, and unlimited incident response for a fixed monthly fee.
The Percona Remote DBA Service provides full operational management of your MySQL
servers. We apply best practices to configure your servers, set up monitoring and alerts,
configure and manage your backups, respond to alerts 24x7x365, perform routine
operational tasks, and help plan for future growth. Our Remote DBA service allows you
to concentrate on enhancing your applications while we care for your databases.
The Percona Backup Service ensures that your backups are properly configured, run
successfully on schedule, and that any backup issues or production data recovery needs
are handled promptly by expert MySQL technicians. The system uses proprietary tools
and methods which reduce the cost and complexity of MySQL backup and recovery
through advanced data storage management. It also provides full visibility into the
status of all of your backups through a convenient online portal.
To learn about any of our services, please contact us at (208) 473-2904 or +44 208 133-
0309 in Europe or email us at sales@percona.com.