SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
SUN AND MYSQL
SOLUTION BUNDLES
Guide to optimizing the Sun Fire™ X4100 M2 or X4200 M2 servers and
the Sun StorageTek™ 2530 Storage Array for MySQL applications

February 2008
Sun Microsystems, Inc.




Table of Contents

Optimizing MySQL® with Sun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
  Business Drivers – The Balance of Strategy and Operations. . . . . . . . . . . . . . . . . . . 1
The Sun MySQL Bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
  Sun Fire™ X4100 M2 and X4200 M2 – More than a Pizza Box . . . . . . . . . . . . . . . . . . 4
  Sun SAS HBA for HA and non-HA Storage Connectivity . . . . . . . . . . . . . . . . . . . . . . 5
  Sun StorageTek 2530 – Faster MySQL Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Steps for Optimizing MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
   Define and Assess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
   Preparation and Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
   Optimize for I/O Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
   Optimize MySQL Memory and CPU Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
   Optimize File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
   Benchmark and Adjust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Appendix A – Optimization Benchmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
  MySQL Sysbench Benchmark Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
     Hardware Installed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
     Software Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
  Sysbench Benchmarks for X4100 M2, X4200 M2, and StorageTek 2530. . . . . . . . . 15
     32 User Read-Only Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
     32 User Read/Write Test Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
     MySQL Settings for Benchmarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1 Sun and MySQL Solution Bundle Optimization Guide                       Sun Microsystems, Inc.




Optimizing MySQL® with Sun
The MySQL database has become the world’s most popular open source database
because of its world-class performance, high-reliability, and ease-of-use. It’s used in
more than 11 million installations ranging from large corporations to specialized
embedded applications on every continent in the world. Sun has teamed with AMD
to build optimized 64-bit, high performance server/connectivity/storage solution
bundles to meet the application demands of customers with of Web 2.0, SME and
departmental database requirements. The word “optimized” means different things
to different IT managers. In this paper, we provide framework for assessing, installing,
and configuring MySQL environments to run faster, safer, and more efficiently on Sun’s
AMD based platforms.

Business Drivers – The Balance of Strategy and Operations
More than ever, IT is the engine that drives business operations. IT has become woven
into the very fabric of our businesses. The role of IT often shifts between strategic and
operational depending on the program in question. This year Web 2.0, Green IT,
Virtualization & Consolidation, and providing better IT Service Level Agreements (SLAs)
at lower costs are high on the list of topics.
• Web 2.0 with MySQL – Wiki’s, smashups, and social networking for business are at
  the forefront of the Web 2.0 movement. Most of these applications need fast,
  efficient, and flexible databases. These tools are growing because they help
   businesses collect and leverage the “tribal knowledge” to make the entire organiza-
   tion smarter and more effective. They help bridge groups of people to solve real
   business challenges for development and customer support.
• Virtualization and consolidation – Nothing has had a more dramatic effect on IT in
  the last two years than virtualization. Like a good smashup application that brings
  new value to old data, virtualization, power and cooling costs, and multi-core CPUs
   have created a “Perfect Storm” of opportunity. These technologies have appeared
   at just the right time, addressing the ongoing need to improve IT efficiency,
   process more transactions, store more data, and support more customers with
   lower overhead.
• Green IT – Green IT is not just about saving the planet, it’s about the real hard dollar
  costs of power, cooling, and rack space in datacenters. In many IT shops in major
  metropolitan areas, such as London or in the financial district of New York City, extra
  power is not available, or has multi-year waiting lists. According to IDC, power and
  cooling costs will exceed $40B (USD) by 2010. IT managers need to partner with
  vendors who can help them build a Green IT strategy.
2 Sun and MySQL Solution Bundle Optimization Guide                      Sun Microsystems, Inc.




The growth of power costs in IT. Source: IDC, 2006.


• Higher SLAs, for less money – This is a theme that never goes away in any business.
  Global competition is relentless. If your company does not optimize, then a new
  company will. The secret to higher SLAs for less money is picking solutions that are
  optimized, designed for lights out operation and support by a global player, ready to
  deploy and ready to make the IT manager’s life easier.

Sun is working with leading technology partners to help IT managers meet these
strategic and tactical needs. Sun and AMD are leaders in virtualization, consolidation,
Green IT and providing higher levels of SLAs. The MySQL bundle is designed to simplify-
deployment and optimization to meet these growing IT needs.


The Sun MySQL Bundle
Sun and AMD are leaders in innovative performance computing. Together they have
teamed to bring the world-class performance of the Sun Fire X4100 M2 and X4200 M2
servers and Sun StorageTek 2530 storage array in a pair of solution bundles that are
ideal for SMEs and departmental needs. For added value, Sun recommends customers
purchase a Sun Spectrum Service plan and take advantage of features such as
hardware service coverage, telephone and online technical support, SunVIP interop
support, and firmware updates to help reduce storage system management costs and
improve performance.
3 Sun and MySQL Solution Bundle Optimization Guide                  Sun Microsystems, Inc.




Bundle details for optimized non-HA and HA MySQL applications:




                                     One Sun Fire X4100 M2 server
                                 • AMD 2220 CPU, 8 GB DDR 400 RAM
                                 • Dual 146 GB SAS and DVD drives




                                             One Sun SAS HBA




                                    One Sun StorageTek 2530 array
                                 • 12 SAS, 73 GB, 15K RPM drives

MySQL Solution Bundle #1




                                    Two Sun Fire X4200 M2 servers
                                 • AMD 2220 CPU, 8 GB DDR 400 RAM
                                 • Dual 146 GB SAS and DVD drives




                                            Four Sun SAS HBAs




                                    One Sun StorageTek 2530 array
                                 • 12 SAS, 146 GB, 15K RPM drives

MySQL Solution Bundle #2
4 Sun and MySQL Solution Bundle Optimization Guide                        Sun Microsystems, Inc.




Sun Fire X4100 M2 and X4200 M2 – More than a Pizza Box
The venerable 1U server is often called the pizza box. Those are not words that
describe the Sun Fire X4100 M2 server, a traditional 1U form factor (Brooklyn Style) and
the Sun X4200 M2, a 2U (Chicago Deep Dish) server. In selecting the solution bundle
components from Sun’s portfolio of products, we chose a best-in-class platform that
helped set a world record for database performance. How do we define best-in-class
for running MySQL?
• More MySQL transactions with HyperTransport memory – For database applications,
     the faster the memory, the better it can perform transactions. The HyperTransport
     architecture of the X4100 M2 and X4200 M2 servers run MySQL faster with aggre-
     gate bandwidth up to 24 GB/s per processor. The AMD Opteron processor with
     HyperTransport provides a scalable direct connection between processors, I/O
     subsystems, and other chipsets. HyperTransport technology helps reduce the
     number of buses in a system, which lowers transaction overhead to improve
     MySQL transactions and queries.
• Industry leading CPU performance1 – The AMD multi-core CPUs of the Sun Fire
  X4100 M2 and X4200 M2 servers deliver industry leading x86 CPU horse power. This
  enables greater consolidation of servers and more VMs of a single system, higher
  performance at a lower cost with managers improve SLAs, lower acquisition costs,
  and increased consolidation.
• Low power and cooling demands2 – The AMD family of CPUs are more power
  efficient CPUs. The Sun Fire X4100 M2 and X4200 M2 servers also use a 2.5 inch
     Serial Attached SCSI (SAS) enterprise class disk drive that offers IOPS performance
     increase and 58 percent power savings compared to today’s 3.5 inch drive. This
     helps IT managers build a Green IT strategy.
• More connectivity for better virtualization – The Sun Fire X4100 M2 and X4200 M2
  servers are the only systems in this class with 4 native 1 GbE ports and embedded
  SAS ports on the base board. The extra connectivity on the Sun Fire X4100 M2 and
  X4200 M2 servers increase systems accessibility by clients and make it more capable
     of hosting high performance applications, and supporting more VMs for a larger set
     of clients. This increased connectivity allows for more bandwidth, without using
     expansion slots and use less power.




1
    sun.com/servers/entry/X4100M2andX4200M2/
2
    sun.com/servers/entry/X4100M2andX4200M2/
5 Sun and MySQL Solution Bundle Optimization Guide                                 Sun Microsystems, Inc.




• More flexible RAS and HA options – The Sun FireX4100 M2 and X4200 M2 servers
  provide the most flexible hot-swap components in its class. This increased
  functionality, combined with our stand-alone ILOM, for lights-out operation makes
  the Sun Fire X4100 M2 and X4200 M2 servers the leader for HA and RAS in the
   x86 market.




                                          Sun Fire X4100 M2
                  For more detailed product images, visit sun.com/servers/entry/x4100




                                          Sun Fire X4200 M2
                  For more detailed product images, visit sun.com/servers/entry/x4200

Sun Fire X4100 M2 and Sun Fire X4200 M2 servers




Sun SAS HBA for HA and non-HA Storage Connectivity
The MySQL HA bundle includes four high performance PCIe SAS Host Bus Adapters
(HBAs) and cabling that provide redundant storage connectivity across both servers.
This enables better load balancing and fail over using Suns tools or native OS features.
The non-HA MySQL bundle includes a single high performance PCIe SAS HBA and
cabling for easy connectivity to the Sun StorageTek 2530. Sun’s PCIe SAS HBA
addresses the need for SAS connectivity in the MySQL Bundle. This HBA offers out-
standing performance by matching 8-lanes of PCIe, with 8-lanes of 3 Gb/s SAS. The SAS
interface allows for point-to-point connection enabling higher performance, increased
aggregate bandwidth, higher availability with dual-ported drives, and enhanced
reliability when compared to parallel SCSI. The SAS interface provides universal
interconnect with Serial ATA (SATA), while still offering logical SCSI compatibility along
with the reliability, performance and manageability available in SAS drives. Common
electrical and physical connection allows for the application to dictate the technology
of choice for disk drives. The Sun StorageTek™ PCIe, SAS Host Bus Adapter, 8-port,
supports the following:
• Two x4 external miniSAS connectors (SFF-8088)
• Connects to both SAS and SATA HDDs
• Allows up to 244 end-point devices
• Enterprise-class HBAs ideal for large or mixed OS environments
• Features the award-winning Fusion-MPT HBA architecture from LSI
• Includes an installed low-profile bracket and full height bracket
• Simultaneous on-board support for x64/x86 BootBIOS (Windows and Linux) and
  Solaris™ SPARC OpenBoot
6 Sun and MySQL Solution Bundle Optimization Guide                      Sun Microsystems, Inc.




Sun StorageTek 2530 – Faster MySQL Queries
Storage is a key component of optimizing MySQL performance. For this bundle, we
selected the SAS-based StorageTek 2530. SAS is the latest storage technology to be
globally adopted for the enterprise, because it brings the high performance and
reliability at a lower cost. The StorageTek 2530 is what SMEs and departments need to
build mission-critical applications on a frugal budget. The Sun StorageTek 2530 array is
an easy-to-use array that delivers better price/performance and greater rack density
than comparable solutions. The StorageTek 2530 is a leading example of Sun’s storage
expertise to provide best-of-breed technology, reliability, and affordability.
• Easy to configure and manage for MySQL – The Sun StorageTek 2530 is ready to
   support MySQL out of the box, making storage management as easy as server
   provisioning. The SMI-S-compliant Sun StorageTek Common Array Manager (CAM)
   software ensures a friendly user interface from setup to administration. The Web-
   based task management interface puts you in control of the array and significantly
   reduces the complexity of installation, configuration, and management. Online
   capacity expansion, data volume control creation, and host-to-volume mapping are
   just a click away, making it easy to make changes quickly and efficiently. CAM is
   accessible from anywhere in the world and includes automated diagnostics so you
   can focus on precise, predictable, repeatable results. CAM also scales across Sun’s
   entire modular disk portfolio.
• More MySQL transactions with 15K SAS Drives – The StorageTek 2530 supports
  multiple sizes and speeds of drive. MySQL has multiple performance needs.
  The Jet and Streaming databases that underlie the application need storage that is
  optimized for random access, while log files require storage that is optimized for
   sequential transactions. The StorageTek 2530, bundled with 73 GB or 146 GB SAS
   drives, provide high performance write-through capability. Additional write-through
   performance can be added by expanding to 36 drives.
• Data protection for MySQL – Managing growth and expansion doesn’t come
  easily, especially when you’re operating within a budget. With dual-active RAID
  controllers, high availability, and high density, the Sun StorageTek 2530 array
   provides a cost-effective solution that lets you take advantage of improved perform-
   ance and low-cost growth. The Active-Active configuration supports load balancing
   and failover for improved performance and HA.
7 Sun and MySQL Solution Bundle Optimization Guide                              Sun Microsystems, Inc.




 Dual Active
 RAID Controllers
 • 12x Hot-Swap SAS drives
 • Bundle #1 – 73 GB @ 15K RPM
 • Bundle #2 – 146 GB @ 15K RPM                                                Front View



 Dual Hot-Swap
 Active-Active
 RAID Controllers
 • Expansion connections
 • Management Ports
                                                                               Rear View

 Dual Hot-Swap
 Power/Cool Modules
 • Dual Power connectors

     For more detailed product images, visit sun.com/storagetek/disk_systems/workgroup/2530/

Sun StorageTek 2530



Steps for Optimizing MySQL
Optimizing your MySQL environment takes planning and understanding of the specific
application running on the database—the SLAs required and the type of I/O required
for the specific application. MySQL can be used for a wide variety of applications and
data types; this means that one-size-dose-not-fit-all for optimization parameters and
settings. In this section we outline a way to evaluate the right settings of your
application.




Steps for optimizing MySQL.
8 Sun and MySQL Solution Bundle Optimization Guide                        Sun Microsystems, Inc.




Define and Assess
Understanding the data is the first step in optimizing the bundled infrastructure to
support MySQL. The nature of the read/write activity and ratios is vital to establish
which settings will help optimize your solutions. The reason for this is to find the
optimal buffers and caches to reduce excess memory and I/O traffic that are tied to the
data characteristics.
• What data types – Knowing your data type helps you understand what type of
   pipeline to create to optimize data transfers, pipeline data movement though the
   server, reduce memory usage, optimize read/write operations out of cache to
   improve performance and in and out of caches. Each data type requires different
   pipelining through the servers and on the array.

Operation                             Block Size                   Mode
Write                                 Small                        Random
Write                                 Large                        Random
Write                                 Small                        Sequential
Write                                 Large                        Sequential
Read                                  Small                        Random
Read                                  Large                        Random
Read                                  Small                        Sequential
Read                                  Large                        Sequential


• User connections – Knowing this up front enables better understanding of the
   overall work load on the server, what MySQL storage engine to load, how to set the
   buffers and caches, how to distribute I/O across the SAS links to the storage, and
   how to configure the array to support the applications. MySQL is a single-process,
   multithreaded application. Besides one master thread with highest priority to con-
   trol the server, it creates a dedicated user thread running at normal priority in the
   thread pools for each simultaneous client request to process the user request and
   send back the result to each client once the result is ready. And there is one single
   user thread that waits for input from the console and a group of utility threads
   running at lower priority to handle some background tasks.

   Currently, MySQL cannot scale well with the number of the user threads handling
   client requests. Performance scales up efficiently with each additional user thread
   until it reaches the peak performance point. After that, increasing the number of
   user connections will decrease MySQL performance because of thread concurrency
   contention. For applications where the number of user connections is tunable,
   you need to determine—for different workloads—the optimum number of user
   connections for peak performance.
• Regulatory requirements – Is this application subject to any specific regulatory
  or security/access control requirements? Does the data need to be stored in a
  dedicated LUN? What are the business continuance requirements? Does the data
  need to replicated synchronously or asynchronously, locally or remotely? It is
  important to understand these requirements before the optimization is planned.
9 Sun and MySQL Solution Bundle Optimization Guide                       Sun Microsystems, Inc.




• SLA requirements – As with regulatory requirements, SLAs drive the type of storage
  and data protection model that needs to be implemented on the array, how the
  data is backed up, how often the backup/snapshot is run. SLAs also help set the
  business continuance requirements for the application.

Preparation and Installation
The preparation for installing the new Sun Fire X4100 M2 or X4200 M2 servers, and
the StorageTek 2530 starts with four basic items:
• Select server bundles – For My SQL applications that are under 1 TB and do not
  require HA configurations we recommend the Sun MySQL Bundle #1 with one
  Sun Fire X4100 M2 server and the StorageTek 2530 loaded with 73 GB drives. For
  data based that require HA servers and are over 1 TB in size we recommend Sun’s
  MySQL Bundle # 2 with two Sun Fire X4200 M2 servers, connected to storage via
  4 SAS HBAs and has the data stored on the StorageTek 2530 loaded with 146 GB
   drives.
• Physical location – Finding the right rack space, power and cooling to support the
  hardware, and required switches and other infrastructure. This should be a simple,
  but required step.
• Installing the Sun Fire X4100 M2 or X4200 M2, StorageTek 2530 and OS – Sun pro-
   vides a detailed step-by-step installation and configurations guide for each product
   at http://docs.sun.com/app/docs/prod/5b03d0ed-216d-11db-a023-080020a9ed93.
   Next is to load the OS of choice for the applications and set up the basic RAID and
   LUN configuration to hold new or migrated data.
• Protect, migrate and validate the data – If this hardware is replacing a current
  server, make sure you have a complete backup of the data set to be moved,
  preferably to another disk array for rapid access. Next, migrate the data from the
   old server storage to the new StorageTek 2530 array and server. Finally, validate that
   the data set was moved properly, especially if you have to erase the backup and
   original copies.
• Load MySQL – The next step in the optimization process is to load MySQL onto the
  new Sun Fire X4100 M2 or X4200 M2 server and test access to the data on the
  new array.

Optimize for I/O Types
Now we are ready to begin the optimization process. We have identified that the I/O
types in our assessment phase.
• Baseline I/O loads – Next is to baseline the current workloads and I/O types on the
  server. This will help measure optimizations in the final benchmarking phase.
• Group I/O types – As we have discussed, optimizations for random, small read/write
  are not the same as larger sequential read/write. If you have multiple I/O types, try
  to segment them on multiple servers or VMs.
• Leverage I/O settings – Grouping similar I/O types together will allow the proper
  cache, files system settings and MySQL storage engines to be used for optimization.
10 Sun and MySQL Solution Bundle Optimization Guide                      Sun Microsystems, Inc.




Optimize MySQL Memory and CPU Options
The next step is to reduce unneeded functions that steal memory and CPU
performance. These include extra buffers that cause extra memory moves of data
and consume CPU resources.
• Reduce CPU and memory uses – One of the key advantages of Open Source
  software solutions is the flexibility to optimize for any need. Using the
  mysql> show variables will help identify the configuration and system variables.
  You can then change values in the my.cnf configuration file, or mysql start up
   options to remove or adjust the following MyISAM memory-related variables if
   you have only Innodb tables in your system:
   – bulk_insert_buffer_size
   – key_buffer_size
   – key_cache_age_threshold, key_cache_block_size
   – key_cache_division_limit
   – read_buffer_size, read_rnd_buffer_size
• Optimize tables – Make sure the tables in the database are optimized for the type of
  queries and sorts required by the application.
• Identify common queries – MySQL query cache stores the identical SELECT queries
  issued by clients to the database server. This makes it possible to locate and re-issue
   the same queries without repetitive hard parsing activities. MySQL also stores the
   query’s result set in the query cache, which can significantly reduce the overhead of
   creating complex result sets for queries from the disk or memory caches, reducing
   both physical and logical I/O. This can speed up applications where repetitive
   queries of products are being issued. If you see a high value for qcache_hits
   compared to your total queries at runtime or a low value for qcache_free_memory
   seen from the mysql>show status, you probably need to increase the value of the
   query_cache_size parameter accordingly. Otherwise, you would decrease the value
   of the query_cache_size parameter to save memory resources for the other MySQL
   cache buffers. If qcache_hit is 0 in the runtime, you would completely turn off
   the query cache by setting query_cache_type as 0, together with setting
   query_cache_size as 0, since there is some overhead caused by having the query
   cache enabled besides wasting the memory resource.
11 Sun and MySQL Solution Bundle Optimization Guide                       Sun Microsystems, Inc.




   If the application uses many simple SELECT queries without repeating, having query
   cache enabled may actually impede performance by 5-10 percent. However, for
   the applications having many repeated SELECT queries with large result set, the
   performance increase set by the query cache can be 200 percent or more.
   – table_cache – Size cache to keep most of tables open since opening tables can be
      expensive. The optimum value for table_cache is directly related to the number
     of tables that need to be open simultaneously in order to perform multiple-table
     joins. The table_cache value should be equal to no less than the number of
     concurrent connections times the largest number tables involved in any one join.
     1024 is a good value for applications with couple hundreds tables (each connec-
     tion has its own entry). You should check the Open_tables status variable to see if
     it is large compared to table_cache.
• Select and configure the MySQL I/O engine – MySQL has many variables that can
  be adjusted to change the MySQL behavior or for performance purpose. MySQL
  includes several storage engines, including MyISAM, InnoDB, HEAP, and Berkeley DB
   (BDB), some variables apply to one of the storage engines only, some variables are
   used in the SQL layer applying to all the storage engines. There are several memory-
   related variables apply for all storage engines. This allow you to optimize the
   storage engine in MySQL:
   – join_buffer_size – Buffer used for full join. In case there are large joins without
     indexes, increase this buffer size to improve the efficiency.
   – sort_buffer_size – Buffer used for sort result set allocated by each thread. This can
     speed up ORDER BY and GROUP BY queries.
   – query_cache_size – Set this variable to a nonzero value to enable query caching
     query_cache_limit – The maximum size for cached result set, the larger result set
     won’t be cached.
   – query_cache_min_res_unit – Query cache allocate memory blocks with the
     minimum size set by this variable. When the application has a lot of queries with
     small results, default block size (4 KB) may lead to memory fragmentation. So,
     with small resultsets, decreasing it to 2048 or 1024 bytes might improve perform-
     ance; with large query resultsets, increase it to be 8192, 16384 or more, may
     speed up the performance.
   – query_cache_type – 0=OFF, 1=ON
• MySQL Innodb only memory-related variables
  – innodb_buffer_pool_size – Set the amount of memory allocated to both Innodb
     data and index buffer cache. MySQL doesn’t access the disk directly; instead, it
     reads data into the internal buffer cache, read/write blocks, and flushes the
     changes back to the disk. If the server requests data available in the cache, the
     data can be processed right away. Otherwise, the operating system will request
     that the data be loaded from the disk. The bigger the cache size, the more disk
     accesses can be avoided. For the sysbench I/O bound workload test on the T2000
     server with 8 GB RAM, increasing innodb_buffer_pool_size from 4 GB to 5 GB can
     improve performance by around 11 percent.
12 Sun and MySQL Solution Bundle Optimization Guide                       Sun Microsystems, Inc.




   – innodb_additional_mem_pool_size – Sets the amount of memory allocated to
     the buffer storing the InnoDB internal data dictionary and other internal data
     structures. This parameter does not affect performance much, so set it as 20M (in
     the application with more tables, more memory needs to be allocated here) in the
     sysbench OLTP test case.
   – innodb_log_buffer_size – Set the amount of memory allocated to the buffer
     storing InnoDB write-ahead log entries. For large transactions, before the
     log buffer is flushed on each transaction commit, if your setting
     innodb_flush_log_at_trx_commit is at 1, the log can be loaded into the log
     buffer instead of flushing to the disk in the background to reduce the disk I/O. If
     you see large log I/O in the show innodb status output at runtime, you probably
     need to set a larger value for the innodb_log_buffer_size parameter. Since the
     sysbench OLTP I/O bound workload doesn’t have long transactions, it is not
     necessary to waste memory resources by setting a higher value for the log buffer,
     so just set it as 8 MB.
• Other MySQL Innodb variables impacting I/O performance
  – innodb_flush_log_at_trx_commit – InnoDB flushes the transaction log
    to disk approximately once per second in the background. As a default,
    innodb_flush_log_at_trx_commit is set as 1 to flush the log to the disk on each
    transaction commit, which is the safest way avoiding transaction loss during
    MySQL, OS, or HW crash. For workloads running with many short transactions,
    you can reduce disk writing by setting the innodb_flush_log_at_trx_commit
    parameter with different values. When setting this value at 0, there is no log
    flushing on each transaction commit. It can reduce the disk I/O to improve
    performance, however, the transaction might be lost if MySQL crashes.
  – innodb_flush_log_at_trx_commit =0 – In the read-only test, this can improve
    performance by 4 percent. When setting this value at 2, the log flushes to the OS
     cache (file system cache) instead of the disk on each transaction commit. It can
     also reduce the disk I/O and perform a little slower than when the value is set at
     0; however, no transaction loss will probably occur with OS or hardware crashes).
   – innodb_log_file_size – InnoDB writes to the log files in a circular fashion, so if the
     log file has reached the configure limit set by the innodb_log_file_size parameter,
     the checkpoint operation is executed at once to flush the modified database
     pages. innodb_log_file_size is very important for write-intensive workloads,
     especially for large data sets. Larger sizes reduces disk I/O in checkpointing for
     better performance but increase recovery times. You will need to increase this
     parameter when you see large page writes in the BUFFER POOL AND MEMORY
     part of the show innodb status output.
13 Sun and MySQL Solution Bundle Optimization Guide                     Sun Microsystems, Inc.




Optimize File Systems
The files system is the next part of the pipeline to optimize. Based on the MySQL
storage engine that was selected, I/O types, this will affect how the files system
should be configured to eliminate double buffering and disk flushing.
• Sync the file systems I/O engine read/write options – File system performance has a
  big impact on the overall system performance, particularly when running I/O
   bound workloads with a database size much bigger than system memory. How to
   configure the file system for better performance is dependent on the workload
   access pattern—random or sequential. For sequential workload, we can increase
   the file system cluster size to allow reading ahead or writing back more data
   from/to the disk to reduce the total number of I/O operations. For random work-
   load, we can reduce the file system cluster size to match the innodb I/O size.
• Reduce double buffers and flushes to disk – Review the buffering model of the
  MySQL I/O storage engine to remove double buffing. This typically occurs when
   both the file’s system and the I/O engine are caching data. This causes extra
   memory moves and uses extra CPU cycles. Before MySQL 5.0.42 and 5.1.18, it needs
   to mount UFS with forcedirectio option. For the later MySQL 5.0.x and 5.1.x, the
   directio can be enabled in my.cnf by setting innodb_flush_method as O_DIRECT.

Benchmark and Adjust
The final step is to put it all together and make any final adjustments. Using the
baseline we establish, run the same tests to measure your improvements. Some
additional tweaking may be required, but this process will help ensure that you get
the most out the Sun MySQL bundle.
14 Sun and MySQL Solution Bundle Optimization Guide                                Sun Microsystems, Inc.




Appendix A – An Optimization Benchmark

MySQL Sysbench Benchmark Configuration

Hardware Installed
Host server type                                      Sun Fire X4100 M2 server
                                                      CPU: 4 x 2793 MHz
                                                      Memory: 7680 MB
Storage model                                         StorageTek 2530
RAID level                                            5
Disk drives                                           Twelve 73 Gb 15K SAS
Storage connectivity (Fiber Channel,                  SAS
SAS, SATA, iSCSI)
Number of storage groups/host                         One
Number of storage controllers                         Two
HBA model                                             PCI-X SAS Host Bus Adapter



StorageTek 2530 configuration
Use the default storage CAMS profile for configuring the volume with RAID level 5,
we used the default segment size (512 KB) and enable read-ahead mode.

Software Installation
Host OS                                               X4100 M2 server: Solaris OS 10 06/06
MySQL Database Server                                 5.0.45
Test applications                                     sysbench


MySQL database server installation steps:
• shell> cd /usr/local
• shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
• shell> ln -s full-path-to-mysql-VERSION-OS mysql
• shell> cd mysql
• shell> scripts/mysql_install_db
• shell> chmod -R 777 *
• shell> bin/mysqld_safe --user=mysql &

Sysbench test installation steps:
• shell> cd /sysbench-version
• shell> ./configure
• shell> make
• shell> make install

Command to Load 100M-row test database:
• shell> sysbench –test=oltp –oltp-table-size=100000000 –mysql-db=sbtest100m –
  max-requests=0 prepare
15 Sun and MySQL Solution Bundle Optimization Guide                               Sun Microsystems, Inc.




Sysbench Benchmarks for X4100 M2 and StorageTek 2530
MySQL Sysbench OLTP I/O Bound Test on Sun Fire X4100 M2 server with
StorageTek 2530

32 User Read-Only Test Results




Sysbench OLTP I/O bound read-only Test with 32 user connections on X4100 M2. The chart above shows
the MySQL performance improvement after tuning the innodb data and index buffer size, tuning Solaris
UFS with maxcontig settings, and directio.




Sysbench OLTP I/O bound read-only test with 2-256 user connections on X4100 M2.



# of user connections                                 Trans/Sec
2                                                     104.73
4                                                     251.33
8                                                     451.56
16                                                    555.64
32                                                    577.96
64                                                    563.84
128                                                   558.66
256                                                   519.96
16 Sun and MySQL Solution Bundle Optimization Guide                               Sun Microsystems, Inc.




32 User Read/Write Test Results




Sysbench OLTP I/O bound read-write Test with 32 user connections on X4100 M2.




Sysbench OLTP I/O bound read-only Test with 2-256 user connections on X4100 M2.




# of user connections                                 Trans/Sec
2                                                     146.04
4                                                     232.05
8                                                     291.1
16                                                    289.12
32                                                    288.51
64                                                    297.32
128                                                   295.32
256                                                   273.91
17 Sun and MySQL Solution Bundle Optimization Guide   Sun Microsystems, Inc.




MySQL Settings for Benchmarks
[mysqld]
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
log-error = /data/error.txt
user=root
skip-locking
max_connections = 3000
table_cache = 1024
max_allowed_packet = 1M
sort_buffer_size = 64K
thread_cache = 8
thread_concurrency = 16
query_cache_size = 0M
query_cache_type = 0
default-storage-engine = innodb
transaction_isolation = REPEATABLE-READ
tmp_table_size = 1M
innodb_data_file_path = ibdata1:100M:autoextend
innodb_buffer_pool_size = 5500M
innodb_additional_mem_pool_size = 20M
innodb_log_file_size =1900M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit =1
innodb_lock_wait_timeout = 300
innodb_max_dirty_pages_pct = 90
innodb_thread_concurrency =16
Sun and MySQL Solution Bundle Optimization Guide                                                                                                                                         Sun Microsystems, Inc.




 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 USA Phone 1-650-960-1300 or 1-800-555-9SUN (9786) Web sun.com
 © 2008 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems, the Sun logo, Sun Fire, StorageTek, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and
 other countries. Information subject to change without notice.                                                                                                                             SunWIN #522027 02/08

Más contenido relacionado

La actualidad más candente

3. ami big data hadoop on ucs seminar may 2013
3. ami big data hadoop on ucs seminar may 20133. ami big data hadoop on ucs seminar may 2013
3. ami big data hadoop on ucs seminar may 2013Taldor Group
 
New Mysql Embedded Guide Wp Nov2012
New Mysql Embedded Guide Wp Nov2012New Mysql Embedded Guide Wp Nov2012
New Mysql Embedded Guide Wp Nov2012hybris2000
 
Data Warehouse Scalability Using Cisco Unified Computing System and Oracle Re...
Data Warehouse Scalability Using Cisco Unified Computing System and Oracle Re...Data Warehouse Scalability Using Cisco Unified Computing System and Oracle Re...
Data Warehouse Scalability Using Cisco Unified Computing System and Oracle Re...EMC
 
MySQL enterprise backup overview
MySQL enterprise backup overviewMySQL enterprise backup overview
MySQL enterprise backup overview郁萍 王
 
Boosting virtualization performance with Intel SSD DC Series P3600 NVMe SSDs ...
Boosting virtualization performance with Intel SSD DC Series P3600 NVMe SSDs ...Boosting virtualization performance with Intel SSD DC Series P3600 NVMe SSDs ...
Boosting virtualization performance with Intel SSD DC Series P3600 NVMe SSDs ...Principled Technologies
 
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550Principled Technologies
 
Boosting performance with the Dell Acceleration Appliance for Databases
Boosting performance with the Dell Acceleration Appliance for DatabasesBoosting performance with the Dell Acceleration Appliance for Databases
Boosting performance with the Dell Acceleration Appliance for DatabasesPrincipled Technologies
 
TECHNICAL BRIEF▶ NetBackup 7.6 Deduplication Technology
TECHNICAL BRIEF▶ NetBackup 7.6 Deduplication TechnologyTECHNICAL BRIEF▶ NetBackup 7.6 Deduplication Technology
TECHNICAL BRIEF▶ NetBackup 7.6 Deduplication TechnologySymantec
 
System IBM x ivy bridge refresh
System IBM x ivy bridge refresh System IBM x ivy bridge refresh
System IBM x ivy bridge refresh Anh Tuan
 
NetBackup Appliance Family presentation
NetBackup Appliance Family presentationNetBackup Appliance Family presentation
NetBackup Appliance Family presentationSymantec
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUGKeith Hollman
 
MongoDB Sharding
MongoDB ShardingMongoDB Sharding
MongoDB Shardinguzzal basak
 
Consolidating Oracle database servers onto Dell PowerEdge R920 running Oracle...
Consolidating Oracle database servers onto Dell PowerEdge R920 running Oracle...Consolidating Oracle database servers onto Dell PowerEdge R920 running Oracle...
Consolidating Oracle database servers onto Dell PowerEdge R920 running Oracle...Principled Technologies
 
TECHNICAL WHITE PAPER▸ NetBackup 7.6 Plugin for VMware vCenter
TECHNICAL WHITE PAPER▸ NetBackup 7.6 Plugin for VMware vCenterTECHNICAL WHITE PAPER▸ NetBackup 7.6 Plugin for VMware vCenter
TECHNICAL WHITE PAPER▸ NetBackup 7.6 Plugin for VMware vCenterSymantec
 
Meb Backup & Recovery Performance
Meb Backup & Recovery PerformanceMeb Backup & Recovery Performance
Meb Backup & Recovery PerformanceKeith Hollman
 

La actualidad más candente (20)

3. ami big data hadoop on ucs seminar may 2013
3. ami big data hadoop on ucs seminar may 20133. ami big data hadoop on ucs seminar may 2013
3. ami big data hadoop on ucs seminar may 2013
 
New Mysql Embedded Guide Wp Nov2012
New Mysql Embedded Guide Wp Nov2012New Mysql Embedded Guide Wp Nov2012
New Mysql Embedded Guide Wp Nov2012
 
Data Warehouse Scalability Using Cisco Unified Computing System and Oracle Re...
Data Warehouse Scalability Using Cisco Unified Computing System and Oracle Re...Data Warehouse Scalability Using Cisco Unified Computing System and Oracle Re...
Data Warehouse Scalability Using Cisco Unified Computing System and Oracle Re...
 
MySQL enterprise backup overview
MySQL enterprise backup overviewMySQL enterprise backup overview
MySQL enterprise backup overview
 
Datastage
DatastageDatastage
Datastage
 
Mcae brief
Mcae briefMcae brief
Mcae brief
 
Boosting virtualization performance with Intel SSD DC Series P3600 NVMe SSDs ...
Boosting virtualization performance with Intel SSD DC Series P3600 NVMe SSDs ...Boosting virtualization performance with Intel SSD DC Series P3600 NVMe SSDs ...
Boosting virtualization performance with Intel SSD DC Series P3600 NVMe SSDs ...
 
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
Database server comparison: Dell PowerEdge R630 vs. Lenovo ThinkServer RD550
 
View RA_v1_HiRez
View RA_v1_HiRezView RA_v1_HiRez
View RA_v1_HiRez
 
Boosting performance with the Dell Acceleration Appliance for Databases
Boosting performance with the Dell Acceleration Appliance for DatabasesBoosting performance with the Dell Acceleration Appliance for Databases
Boosting performance with the Dell Acceleration Appliance for Databases
 
Netezza All labs
Netezza All labsNetezza All labs
Netezza All labs
 
TECHNICAL BRIEF▶ NetBackup 7.6 Deduplication Technology
TECHNICAL BRIEF▶ NetBackup 7.6 Deduplication TechnologyTECHNICAL BRIEF▶ NetBackup 7.6 Deduplication Technology
TECHNICAL BRIEF▶ NetBackup 7.6 Deduplication Technology
 
Db2 bp hadr_1111
Db2 bp hadr_1111Db2 bp hadr_1111
Db2 bp hadr_1111
 
System IBM x ivy bridge refresh
System IBM x ivy bridge refresh System IBM x ivy bridge refresh
System IBM x ivy bridge refresh
 
NetBackup Appliance Family presentation
NetBackup Appliance Family presentationNetBackup Appliance Family presentation
NetBackup Appliance Family presentation
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
 
MongoDB Sharding
MongoDB ShardingMongoDB Sharding
MongoDB Sharding
 
Consolidating Oracle database servers onto Dell PowerEdge R920 running Oracle...
Consolidating Oracle database servers onto Dell PowerEdge R920 running Oracle...Consolidating Oracle database servers onto Dell PowerEdge R920 running Oracle...
Consolidating Oracle database servers onto Dell PowerEdge R920 running Oracle...
 
TECHNICAL WHITE PAPER▸ NetBackup 7.6 Plugin for VMware vCenter
TECHNICAL WHITE PAPER▸ NetBackup 7.6 Plugin for VMware vCenterTECHNICAL WHITE PAPER▸ NetBackup 7.6 Plugin for VMware vCenter
TECHNICAL WHITE PAPER▸ NetBackup 7.6 Plugin for VMware vCenter
 
Meb Backup & Recovery Performance
Meb Backup & Recovery PerformanceMeb Backup & Recovery Performance
Meb Backup & Recovery Performance
 

Destacado

HP Universal Server Migration Pack - Magnus Wetterberg.ppt
HP Universal Server Migration Pack - Magnus Wetterberg.pptHP Universal Server Migration Pack - Magnus Wetterberg.ppt
HP Universal Server Migration Pack - Magnus Wetterberg.pptwebhostingguy
 
Hollis - Sustainable..
Hollis - Sustainable..Hollis - Sustainable..
Hollis - Sustainable..webhostingguy
 
WebHost Manager 1.01 User Guide
WebHost Manager 1.01 User GuideWebHost Manager 1.01 User Guide
WebHost Manager 1.01 User Guidewebhostingguy
 
A User's Guide to Helm™
A User's Guide to Helm™A User's Guide to Helm™
A User's Guide to Helm™webhostingguy
 
Physician Practices: Are Application Service Providers Right ...
Physician Practices: Are Application Service Providers Right ...Physician Practices: Are Application Service Providers Right ...
Physician Practices: Are Application Service Providers Right ...webhostingguy
 
Technology on a Shoestring Michelle Murrain
Technology on a Shoestring Michelle MurrainTechnology on a Shoestring Michelle Murrain
Technology on a Shoestring Michelle Murrainwebhostingguy
 
Automation as a Competitive Adv - no notes
Automation as a Competitive Adv - no notesAutomation as a Competitive Adv - no notes
Automation as a Competitive Adv - no noteswebhostingguy
 

Destacado (8)

HP Universal Server Migration Pack - Magnus Wetterberg.ppt
HP Universal Server Migration Pack - Magnus Wetterberg.pptHP Universal Server Migration Pack - Magnus Wetterberg.ppt
HP Universal Server Migration Pack - Magnus Wetterberg.ppt
 
Pictures From Space
Pictures From SpacePictures From Space
Pictures From Space
 
Hollis - Sustainable..
Hollis - Sustainable..Hollis - Sustainable..
Hollis - Sustainable..
 
WebHost Manager 1.01 User Guide
WebHost Manager 1.01 User GuideWebHost Manager 1.01 User Guide
WebHost Manager 1.01 User Guide
 
A User's Guide to Helm™
A User's Guide to Helm™A User's Guide to Helm™
A User's Guide to Helm™
 
Physician Practices: Are Application Service Providers Right ...
Physician Practices: Are Application Service Providers Right ...Physician Practices: Are Application Service Providers Right ...
Physician Practices: Are Application Service Providers Right ...
 
Technology on a Shoestring Michelle Murrain
Technology on a Shoestring Michelle MurrainTechnology on a Shoestring Michelle Murrain
Technology on a Shoestring Michelle Murrain
 
Automation as a Competitive Adv - no notes
Automation as a Competitive Adv - no notesAutomation as a Competitive Adv - no notes
Automation as a Competitive Adv - no notes
 

Similar a SOLUTION BUNDLES

Juniper: Data Center Evolution
Juniper: Data Center EvolutionJuniper: Data Center Evolution
Juniper: Data Center EvolutionTechnologyBIZ
 
My sql performance tuning course
My sql performance tuning courseMy sql performance tuning course
My sql performance tuning courseAlberto Centanni
 
Intelligent storage management solution using VMware vSphere 5.0 Storage DRS:...
Intelligent storage management solution using VMware vSphere 5.0 Storage DRS:...Intelligent storage management solution using VMware vSphere 5.0 Storage DRS:...
Intelligent storage management solution using VMware vSphere 5.0 Storage DRS:...IBM India Smarter Computing
 
Presentation data center design overview
Presentation   data center design overviewPresentation   data center design overview
Presentation data center design overviewxKinAnx
 
IBM Flex System Solution for Microsoft Hyper-V (2-node) Reference Architecture
IBM Flex System Solution for Microsoft Hyper-V (2-node) Reference ArchitectureIBM Flex System Solution for Microsoft Hyper-V (2-node) Reference Architecture
IBM Flex System Solution for Microsoft Hyper-V (2-node) Reference ArchitectureIBM India Smarter Computing
 
IBM SONAS Enterprise backup and remote replication solution in a private cloud
IBM SONAS Enterprise backup and remote replication solution in a private cloudIBM SONAS Enterprise backup and remote replication solution in a private cloud
IBM SONAS Enterprise backup and remote replication solution in a private cloudIBM India Smarter Computing
 
IBM SONAS Enterprise backup and remote replication solution in a private cloud
IBM SONAS Enterprise backup and remote replication solution in a private cloudIBM SONAS Enterprise backup and remote replication solution in a private cloud
IBM SONAS Enterprise backup and remote replication solution in a private cloudIBM India Smarter Computing
 
IBM BCFC White Paper - Why Choose IBM BladeCenter Foundation for Cloud
IBM BCFC White Paper - Why Choose IBM BladeCenter Foundation for CloudIBM BCFC White Paper - Why Choose IBM BladeCenter Foundation for Cloud
IBM BCFC White Paper - Why Choose IBM BladeCenter Foundation for CloudIBM India Smarter Computing
 
Vmware nsx network virtualization platform white paper
Vmware nsx network virtualization platform white paperVmware nsx network virtualization platform white paper
Vmware nsx network virtualization platform white paperCloudSyntrix
 
VMware-NSX-Network-Virtualization-Platform-WP
VMware-NSX-Network-Virtualization-Platform-WPVMware-NSX-Network-Virtualization-Platform-WP
VMware-NSX-Network-Virtualization-Platform-WPStephen Fenton
 
Vmware nsx-network-virtualization-platform-white-paper
Vmware nsx-network-virtualization-platform-white-paperVmware nsx-network-virtualization-platform-white-paper
Vmware nsx-network-virtualization-platform-white-paperCloudSyntrix
 
Getting Started with the IBM PowerLinux Solution Edition for SAP Applications
Getting Started with the IBM PowerLinux Solution Edition for SAP ApplicationsGetting Started with the IBM PowerLinux Solution Edition for SAP Applications
Getting Started with the IBM PowerLinux Solution Edition for SAP ApplicationsIBM India Smarter Computing
 
UCS Update: Efficiently Managing your server environment for traditional ente...
UCS Update: Efficiently Managing your server environment for traditional ente...UCS Update: Efficiently Managing your server environment for traditional ente...
UCS Update: Efficiently Managing your server environment for traditional ente...Cisco Canada
 
IBM Pure Data System for Analytics (Netezza)
IBM Pure Data System for Analytics (Netezza)IBM Pure Data System for Analytics (Netezza)
IBM Pure Data System for Analytics (Netezza)Girish Srivastava
 
Guide to NoSQL with MySQL
Guide to NoSQL with MySQLGuide to NoSQL with MySQL
Guide to NoSQL with MySQLSamuel Rohaut
 
Deploying oracle rac 10g with asm on rhel and sles with svc
Deploying oracle rac 10g with asm on rhel and sles with svcDeploying oracle rac 10g with asm on rhel and sles with svc
Deploying oracle rac 10g with asm on rhel and sles with svcwikiwei
 
#VirtualDesignMaster 3 Challenge 3 – James Brown
#VirtualDesignMaster 3 Challenge 3 – James Brown#VirtualDesignMaster 3 Challenge 3 – James Brown
#VirtualDesignMaster 3 Challenge 3 – James Brownvdmchallenge
 
Cisco connect montreal 2018 compute v final
Cisco connect montreal 2018   compute v finalCisco connect montreal 2018   compute v final
Cisco connect montreal 2018 compute v finalCisco Canada
 

Similar a SOLUTION BUNDLES (20)

Juniper: Data Center Evolution
Juniper: Data Center EvolutionJuniper: Data Center Evolution
Juniper: Data Center Evolution
 
My sql performance tuning course
My sql performance tuning courseMy sql performance tuning course
My sql performance tuning course
 
Bb sql serverdell
Bb sql serverdellBb sql serverdell
Bb sql serverdell
 
Intelligent storage management solution using VMware vSphere 5.0 Storage DRS:...
Intelligent storage management solution using VMware vSphere 5.0 Storage DRS:...Intelligent storage management solution using VMware vSphere 5.0 Storage DRS:...
Intelligent storage management solution using VMware vSphere 5.0 Storage DRS:...
 
Lenovo midokura
Lenovo midokuraLenovo midokura
Lenovo midokura
 
Presentation data center design overview
Presentation   data center design overviewPresentation   data center design overview
Presentation data center design overview
 
IBM Flex System Solution for Microsoft Hyper-V (2-node) Reference Architecture
IBM Flex System Solution for Microsoft Hyper-V (2-node) Reference ArchitectureIBM Flex System Solution for Microsoft Hyper-V (2-node) Reference Architecture
IBM Flex System Solution for Microsoft Hyper-V (2-node) Reference Architecture
 
IBM SONAS Enterprise backup and remote replication solution in a private cloud
IBM SONAS Enterprise backup and remote replication solution in a private cloudIBM SONAS Enterprise backup and remote replication solution in a private cloud
IBM SONAS Enterprise backup and remote replication solution in a private cloud
 
IBM SONAS Enterprise backup and remote replication solution in a private cloud
IBM SONAS Enterprise backup and remote replication solution in a private cloudIBM SONAS Enterprise backup and remote replication solution in a private cloud
IBM SONAS Enterprise backup and remote replication solution in a private cloud
 
IBM BCFC White Paper - Why Choose IBM BladeCenter Foundation for Cloud
IBM BCFC White Paper - Why Choose IBM BladeCenter Foundation for CloudIBM BCFC White Paper - Why Choose IBM BladeCenter Foundation for Cloud
IBM BCFC White Paper - Why Choose IBM BladeCenter Foundation for Cloud
 
Vmware nsx network virtualization platform white paper
Vmware nsx network virtualization platform white paperVmware nsx network virtualization platform white paper
Vmware nsx network virtualization platform white paper
 
VMware-NSX-Network-Virtualization-Platform-WP
VMware-NSX-Network-Virtualization-Platform-WPVMware-NSX-Network-Virtualization-Platform-WP
VMware-NSX-Network-Virtualization-Platform-WP
 
Vmware nsx-network-virtualization-platform-white-paper
Vmware nsx-network-virtualization-platform-white-paperVmware nsx-network-virtualization-platform-white-paper
Vmware nsx-network-virtualization-platform-white-paper
 
Getting Started with the IBM PowerLinux Solution Edition for SAP Applications
Getting Started with the IBM PowerLinux Solution Edition for SAP ApplicationsGetting Started with the IBM PowerLinux Solution Edition for SAP Applications
Getting Started with the IBM PowerLinux Solution Edition for SAP Applications
 
UCS Update: Efficiently Managing your server environment for traditional ente...
UCS Update: Efficiently Managing your server environment for traditional ente...UCS Update: Efficiently Managing your server environment for traditional ente...
UCS Update: Efficiently Managing your server environment for traditional ente...
 
IBM Pure Data System for Analytics (Netezza)
IBM Pure Data System for Analytics (Netezza)IBM Pure Data System for Analytics (Netezza)
IBM Pure Data System for Analytics (Netezza)
 
Guide to NoSQL with MySQL
Guide to NoSQL with MySQLGuide to NoSQL with MySQL
Guide to NoSQL with MySQL
 
Deploying oracle rac 10g with asm on rhel and sles with svc
Deploying oracle rac 10g with asm on rhel and sles with svcDeploying oracle rac 10g with asm on rhel and sles with svc
Deploying oracle rac 10g with asm on rhel and sles with svc
 
#VirtualDesignMaster 3 Challenge 3 – James Brown
#VirtualDesignMaster 3 Challenge 3 – James Brown#VirtualDesignMaster 3 Challenge 3 – James Brown
#VirtualDesignMaster 3 Challenge 3 – James Brown
 
Cisco connect montreal 2018 compute v final
Cisco connect montreal 2018   compute v finalCisco connect montreal 2018   compute v final
Cisco connect montreal 2018 compute v final
 

Más de webhostingguy

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Frameworkwebhostingguy
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guidewebhostingguy
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3webhostingguy
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serverswebhostingguy
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidationwebhostingguy
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreementwebhostingguy
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...webhostingguy
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...webhostingguy
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructurewebhostingguy
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.pptwebhostingguy
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy webhostingguy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandiserswebhostingguy
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Productswebhostingguy
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mbwebhostingguy
 

Más de webhostingguy (20)

File Upload
File UploadFile Upload
File Upload
 
Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guide
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web servers
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidation
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreement
 
Notes8
Notes8Notes8
Notes8
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructure
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.ppt
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandisers
 
OLUG_xen.ppt
OLUG_xen.pptOLUG_xen.ppt
OLUG_xen.ppt
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Products
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mb
 
Reseller's Guide
Reseller's GuideReseller's Guide
Reseller's Guide
 

SOLUTION BUNDLES

  • 1. SUN AND MYSQL SOLUTION BUNDLES Guide to optimizing the Sun Fire™ X4100 M2 or X4200 M2 servers and the Sun StorageTek™ 2530 Storage Array for MySQL applications February 2008
  • 2. Sun Microsystems, Inc. Table of Contents Optimizing MySQL® with Sun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Business Drivers – The Balance of Strategy and Operations. . . . . . . . . . . . . . . . . . . 1 The Sun MySQL Bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Sun Fire™ X4100 M2 and X4200 M2 – More than a Pizza Box . . . . . . . . . . . . . . . . . . 4 Sun SAS HBA for HA and non-HA Storage Connectivity . . . . . . . . . . . . . . . . . . . . . . 5 Sun StorageTek 2530 – Faster MySQL Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Steps for Optimizing MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Define and Assess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Preparation and Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Optimize for I/O Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Optimize MySQL Memory and CPU Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Optimize File Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Benchmark and Adjust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Appendix A – Optimization Benchmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 MySQL Sysbench Benchmark Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Hardware Installed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Software Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Sysbench Benchmarks for X4100 M2, X4200 M2, and StorageTek 2530. . . . . . . . . 15 32 User Read-Only Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 32 User Read/Write Test Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 MySQL Settings for Benchmarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
  • 3. 1 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Optimizing MySQL® with Sun The MySQL database has become the world’s most popular open source database because of its world-class performance, high-reliability, and ease-of-use. It’s used in more than 11 million installations ranging from large corporations to specialized embedded applications on every continent in the world. Sun has teamed with AMD to build optimized 64-bit, high performance server/connectivity/storage solution bundles to meet the application demands of customers with of Web 2.0, SME and departmental database requirements. The word “optimized” means different things to different IT managers. In this paper, we provide framework for assessing, installing, and configuring MySQL environments to run faster, safer, and more efficiently on Sun’s AMD based platforms. Business Drivers – The Balance of Strategy and Operations More than ever, IT is the engine that drives business operations. IT has become woven into the very fabric of our businesses. The role of IT often shifts between strategic and operational depending on the program in question. This year Web 2.0, Green IT, Virtualization & Consolidation, and providing better IT Service Level Agreements (SLAs) at lower costs are high on the list of topics. • Web 2.0 with MySQL – Wiki’s, smashups, and social networking for business are at the forefront of the Web 2.0 movement. Most of these applications need fast, efficient, and flexible databases. These tools are growing because they help businesses collect and leverage the “tribal knowledge” to make the entire organiza- tion smarter and more effective. They help bridge groups of people to solve real business challenges for development and customer support. • Virtualization and consolidation – Nothing has had a more dramatic effect on IT in the last two years than virtualization. Like a good smashup application that brings new value to old data, virtualization, power and cooling costs, and multi-core CPUs have created a “Perfect Storm” of opportunity. These technologies have appeared at just the right time, addressing the ongoing need to improve IT efficiency, process more transactions, store more data, and support more customers with lower overhead. • Green IT – Green IT is not just about saving the planet, it’s about the real hard dollar costs of power, cooling, and rack space in datacenters. In many IT shops in major metropolitan areas, such as London or in the financial district of New York City, extra power is not available, or has multi-year waiting lists. According to IDC, power and cooling costs will exceed $40B (USD) by 2010. IT managers need to partner with vendors who can help them build a Green IT strategy.
  • 4. 2 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. The growth of power costs in IT. Source: IDC, 2006. • Higher SLAs, for less money – This is a theme that never goes away in any business. Global competition is relentless. If your company does not optimize, then a new company will. The secret to higher SLAs for less money is picking solutions that are optimized, designed for lights out operation and support by a global player, ready to deploy and ready to make the IT manager’s life easier. Sun is working with leading technology partners to help IT managers meet these strategic and tactical needs. Sun and AMD are leaders in virtualization, consolidation, Green IT and providing higher levels of SLAs. The MySQL bundle is designed to simplify- deployment and optimization to meet these growing IT needs. The Sun MySQL Bundle Sun and AMD are leaders in innovative performance computing. Together they have teamed to bring the world-class performance of the Sun Fire X4100 M2 and X4200 M2 servers and Sun StorageTek 2530 storage array in a pair of solution bundles that are ideal for SMEs and departmental needs. For added value, Sun recommends customers purchase a Sun Spectrum Service plan and take advantage of features such as hardware service coverage, telephone and online technical support, SunVIP interop support, and firmware updates to help reduce storage system management costs and improve performance.
  • 5. 3 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Bundle details for optimized non-HA and HA MySQL applications: One Sun Fire X4100 M2 server • AMD 2220 CPU, 8 GB DDR 400 RAM • Dual 146 GB SAS and DVD drives One Sun SAS HBA One Sun StorageTek 2530 array • 12 SAS, 73 GB, 15K RPM drives MySQL Solution Bundle #1 Two Sun Fire X4200 M2 servers • AMD 2220 CPU, 8 GB DDR 400 RAM • Dual 146 GB SAS and DVD drives Four Sun SAS HBAs One Sun StorageTek 2530 array • 12 SAS, 146 GB, 15K RPM drives MySQL Solution Bundle #2
  • 6. 4 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Sun Fire X4100 M2 and X4200 M2 – More than a Pizza Box The venerable 1U server is often called the pizza box. Those are not words that describe the Sun Fire X4100 M2 server, a traditional 1U form factor (Brooklyn Style) and the Sun X4200 M2, a 2U (Chicago Deep Dish) server. In selecting the solution bundle components from Sun’s portfolio of products, we chose a best-in-class platform that helped set a world record for database performance. How do we define best-in-class for running MySQL? • More MySQL transactions with HyperTransport memory – For database applications, the faster the memory, the better it can perform transactions. The HyperTransport architecture of the X4100 M2 and X4200 M2 servers run MySQL faster with aggre- gate bandwidth up to 24 GB/s per processor. The AMD Opteron processor with HyperTransport provides a scalable direct connection between processors, I/O subsystems, and other chipsets. HyperTransport technology helps reduce the number of buses in a system, which lowers transaction overhead to improve MySQL transactions and queries. • Industry leading CPU performance1 – The AMD multi-core CPUs of the Sun Fire X4100 M2 and X4200 M2 servers deliver industry leading x86 CPU horse power. This enables greater consolidation of servers and more VMs of a single system, higher performance at a lower cost with managers improve SLAs, lower acquisition costs, and increased consolidation. • Low power and cooling demands2 – The AMD family of CPUs are more power efficient CPUs. The Sun Fire X4100 M2 and X4200 M2 servers also use a 2.5 inch Serial Attached SCSI (SAS) enterprise class disk drive that offers IOPS performance increase and 58 percent power savings compared to today’s 3.5 inch drive. This helps IT managers build a Green IT strategy. • More connectivity for better virtualization – The Sun Fire X4100 M2 and X4200 M2 servers are the only systems in this class with 4 native 1 GbE ports and embedded SAS ports on the base board. The extra connectivity on the Sun Fire X4100 M2 and X4200 M2 servers increase systems accessibility by clients and make it more capable of hosting high performance applications, and supporting more VMs for a larger set of clients. This increased connectivity allows for more bandwidth, without using expansion slots and use less power. 1 sun.com/servers/entry/X4100M2andX4200M2/ 2 sun.com/servers/entry/X4100M2andX4200M2/
  • 7. 5 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. • More flexible RAS and HA options – The Sun FireX4100 M2 and X4200 M2 servers provide the most flexible hot-swap components in its class. This increased functionality, combined with our stand-alone ILOM, for lights-out operation makes the Sun Fire X4100 M2 and X4200 M2 servers the leader for HA and RAS in the x86 market. Sun Fire X4100 M2 For more detailed product images, visit sun.com/servers/entry/x4100 Sun Fire X4200 M2 For more detailed product images, visit sun.com/servers/entry/x4200 Sun Fire X4100 M2 and Sun Fire X4200 M2 servers Sun SAS HBA for HA and non-HA Storage Connectivity The MySQL HA bundle includes four high performance PCIe SAS Host Bus Adapters (HBAs) and cabling that provide redundant storage connectivity across both servers. This enables better load balancing and fail over using Suns tools or native OS features. The non-HA MySQL bundle includes a single high performance PCIe SAS HBA and cabling for easy connectivity to the Sun StorageTek 2530. Sun’s PCIe SAS HBA addresses the need for SAS connectivity in the MySQL Bundle. This HBA offers out- standing performance by matching 8-lanes of PCIe, with 8-lanes of 3 Gb/s SAS. The SAS interface allows for point-to-point connection enabling higher performance, increased aggregate bandwidth, higher availability with dual-ported drives, and enhanced reliability when compared to parallel SCSI. The SAS interface provides universal interconnect with Serial ATA (SATA), while still offering logical SCSI compatibility along with the reliability, performance and manageability available in SAS drives. Common electrical and physical connection allows for the application to dictate the technology of choice for disk drives. The Sun StorageTek™ PCIe, SAS Host Bus Adapter, 8-port, supports the following: • Two x4 external miniSAS connectors (SFF-8088) • Connects to both SAS and SATA HDDs • Allows up to 244 end-point devices • Enterprise-class HBAs ideal for large or mixed OS environments • Features the award-winning Fusion-MPT HBA architecture from LSI • Includes an installed low-profile bracket and full height bracket • Simultaneous on-board support for x64/x86 BootBIOS (Windows and Linux) and Solaris™ SPARC OpenBoot
  • 8. 6 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Sun StorageTek 2530 – Faster MySQL Queries Storage is a key component of optimizing MySQL performance. For this bundle, we selected the SAS-based StorageTek 2530. SAS is the latest storage technology to be globally adopted for the enterprise, because it brings the high performance and reliability at a lower cost. The StorageTek 2530 is what SMEs and departments need to build mission-critical applications on a frugal budget. The Sun StorageTek 2530 array is an easy-to-use array that delivers better price/performance and greater rack density than comparable solutions. The StorageTek 2530 is a leading example of Sun’s storage expertise to provide best-of-breed technology, reliability, and affordability. • Easy to configure and manage for MySQL – The Sun StorageTek 2530 is ready to support MySQL out of the box, making storage management as easy as server provisioning. The SMI-S-compliant Sun StorageTek Common Array Manager (CAM) software ensures a friendly user interface from setup to administration. The Web- based task management interface puts you in control of the array and significantly reduces the complexity of installation, configuration, and management. Online capacity expansion, data volume control creation, and host-to-volume mapping are just a click away, making it easy to make changes quickly and efficiently. CAM is accessible from anywhere in the world and includes automated diagnostics so you can focus on precise, predictable, repeatable results. CAM also scales across Sun’s entire modular disk portfolio. • More MySQL transactions with 15K SAS Drives – The StorageTek 2530 supports multiple sizes and speeds of drive. MySQL has multiple performance needs. The Jet and Streaming databases that underlie the application need storage that is optimized for random access, while log files require storage that is optimized for sequential transactions. The StorageTek 2530, bundled with 73 GB or 146 GB SAS drives, provide high performance write-through capability. Additional write-through performance can be added by expanding to 36 drives. • Data protection for MySQL – Managing growth and expansion doesn’t come easily, especially when you’re operating within a budget. With dual-active RAID controllers, high availability, and high density, the Sun StorageTek 2530 array provides a cost-effective solution that lets you take advantage of improved perform- ance and low-cost growth. The Active-Active configuration supports load balancing and failover for improved performance and HA.
  • 9. 7 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Dual Active RAID Controllers • 12x Hot-Swap SAS drives • Bundle #1 – 73 GB @ 15K RPM • Bundle #2 – 146 GB @ 15K RPM Front View Dual Hot-Swap Active-Active RAID Controllers • Expansion connections • Management Ports Rear View Dual Hot-Swap Power/Cool Modules • Dual Power connectors For more detailed product images, visit sun.com/storagetek/disk_systems/workgroup/2530/ Sun StorageTek 2530 Steps for Optimizing MySQL Optimizing your MySQL environment takes planning and understanding of the specific application running on the database—the SLAs required and the type of I/O required for the specific application. MySQL can be used for a wide variety of applications and data types; this means that one-size-dose-not-fit-all for optimization parameters and settings. In this section we outline a way to evaluate the right settings of your application. Steps for optimizing MySQL.
  • 10. 8 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Define and Assess Understanding the data is the first step in optimizing the bundled infrastructure to support MySQL. The nature of the read/write activity and ratios is vital to establish which settings will help optimize your solutions. The reason for this is to find the optimal buffers and caches to reduce excess memory and I/O traffic that are tied to the data characteristics. • What data types – Knowing your data type helps you understand what type of pipeline to create to optimize data transfers, pipeline data movement though the server, reduce memory usage, optimize read/write operations out of cache to improve performance and in and out of caches. Each data type requires different pipelining through the servers and on the array. Operation Block Size Mode Write Small Random Write Large Random Write Small Sequential Write Large Sequential Read Small Random Read Large Random Read Small Sequential Read Large Sequential • User connections – Knowing this up front enables better understanding of the overall work load on the server, what MySQL storage engine to load, how to set the buffers and caches, how to distribute I/O across the SAS links to the storage, and how to configure the array to support the applications. MySQL is a single-process, multithreaded application. Besides one master thread with highest priority to con- trol the server, it creates a dedicated user thread running at normal priority in the thread pools for each simultaneous client request to process the user request and send back the result to each client once the result is ready. And there is one single user thread that waits for input from the console and a group of utility threads running at lower priority to handle some background tasks. Currently, MySQL cannot scale well with the number of the user threads handling client requests. Performance scales up efficiently with each additional user thread until it reaches the peak performance point. After that, increasing the number of user connections will decrease MySQL performance because of thread concurrency contention. For applications where the number of user connections is tunable, you need to determine—for different workloads—the optimum number of user connections for peak performance. • Regulatory requirements – Is this application subject to any specific regulatory or security/access control requirements? Does the data need to be stored in a dedicated LUN? What are the business continuance requirements? Does the data need to replicated synchronously or asynchronously, locally or remotely? It is important to understand these requirements before the optimization is planned.
  • 11. 9 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. • SLA requirements – As with regulatory requirements, SLAs drive the type of storage and data protection model that needs to be implemented on the array, how the data is backed up, how often the backup/snapshot is run. SLAs also help set the business continuance requirements for the application. Preparation and Installation The preparation for installing the new Sun Fire X4100 M2 or X4200 M2 servers, and the StorageTek 2530 starts with four basic items: • Select server bundles – For My SQL applications that are under 1 TB and do not require HA configurations we recommend the Sun MySQL Bundle #1 with one Sun Fire X4100 M2 server and the StorageTek 2530 loaded with 73 GB drives. For data based that require HA servers and are over 1 TB in size we recommend Sun’s MySQL Bundle # 2 with two Sun Fire X4200 M2 servers, connected to storage via 4 SAS HBAs and has the data stored on the StorageTek 2530 loaded with 146 GB drives. • Physical location – Finding the right rack space, power and cooling to support the hardware, and required switches and other infrastructure. This should be a simple, but required step. • Installing the Sun Fire X4100 M2 or X4200 M2, StorageTek 2530 and OS – Sun pro- vides a detailed step-by-step installation and configurations guide for each product at http://docs.sun.com/app/docs/prod/5b03d0ed-216d-11db-a023-080020a9ed93. Next is to load the OS of choice for the applications and set up the basic RAID and LUN configuration to hold new or migrated data. • Protect, migrate and validate the data – If this hardware is replacing a current server, make sure you have a complete backup of the data set to be moved, preferably to another disk array for rapid access. Next, migrate the data from the old server storage to the new StorageTek 2530 array and server. Finally, validate that the data set was moved properly, especially if you have to erase the backup and original copies. • Load MySQL – The next step in the optimization process is to load MySQL onto the new Sun Fire X4100 M2 or X4200 M2 server and test access to the data on the new array. Optimize for I/O Types Now we are ready to begin the optimization process. We have identified that the I/O types in our assessment phase. • Baseline I/O loads – Next is to baseline the current workloads and I/O types on the server. This will help measure optimizations in the final benchmarking phase. • Group I/O types – As we have discussed, optimizations for random, small read/write are not the same as larger sequential read/write. If you have multiple I/O types, try to segment them on multiple servers or VMs. • Leverage I/O settings – Grouping similar I/O types together will allow the proper cache, files system settings and MySQL storage engines to be used for optimization.
  • 12. 10 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Optimize MySQL Memory and CPU Options The next step is to reduce unneeded functions that steal memory and CPU performance. These include extra buffers that cause extra memory moves of data and consume CPU resources. • Reduce CPU and memory uses – One of the key advantages of Open Source software solutions is the flexibility to optimize for any need. Using the mysql> show variables will help identify the configuration and system variables. You can then change values in the my.cnf configuration file, or mysql start up options to remove or adjust the following MyISAM memory-related variables if you have only Innodb tables in your system: – bulk_insert_buffer_size – key_buffer_size – key_cache_age_threshold, key_cache_block_size – key_cache_division_limit – read_buffer_size, read_rnd_buffer_size • Optimize tables – Make sure the tables in the database are optimized for the type of queries and sorts required by the application. • Identify common queries – MySQL query cache stores the identical SELECT queries issued by clients to the database server. This makes it possible to locate and re-issue the same queries without repetitive hard parsing activities. MySQL also stores the query’s result set in the query cache, which can significantly reduce the overhead of creating complex result sets for queries from the disk or memory caches, reducing both physical and logical I/O. This can speed up applications where repetitive queries of products are being issued. If you see a high value for qcache_hits compared to your total queries at runtime or a low value for qcache_free_memory seen from the mysql>show status, you probably need to increase the value of the query_cache_size parameter accordingly. Otherwise, you would decrease the value of the query_cache_size parameter to save memory resources for the other MySQL cache buffers. If qcache_hit is 0 in the runtime, you would completely turn off the query cache by setting query_cache_type as 0, together with setting query_cache_size as 0, since there is some overhead caused by having the query cache enabled besides wasting the memory resource.
  • 13. 11 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. If the application uses many simple SELECT queries without repeating, having query cache enabled may actually impede performance by 5-10 percent. However, for the applications having many repeated SELECT queries with large result set, the performance increase set by the query cache can be 200 percent or more. – table_cache – Size cache to keep most of tables open since opening tables can be expensive. The optimum value for table_cache is directly related to the number of tables that need to be open simultaneously in order to perform multiple-table joins. The table_cache value should be equal to no less than the number of concurrent connections times the largest number tables involved in any one join. 1024 is a good value for applications with couple hundreds tables (each connec- tion has its own entry). You should check the Open_tables status variable to see if it is large compared to table_cache. • Select and configure the MySQL I/O engine – MySQL has many variables that can be adjusted to change the MySQL behavior or for performance purpose. MySQL includes several storage engines, including MyISAM, InnoDB, HEAP, and Berkeley DB (BDB), some variables apply to one of the storage engines only, some variables are used in the SQL layer applying to all the storage engines. There are several memory- related variables apply for all storage engines. This allow you to optimize the storage engine in MySQL: – join_buffer_size – Buffer used for full join. In case there are large joins without indexes, increase this buffer size to improve the efficiency. – sort_buffer_size – Buffer used for sort result set allocated by each thread. This can speed up ORDER BY and GROUP BY queries. – query_cache_size – Set this variable to a nonzero value to enable query caching query_cache_limit – The maximum size for cached result set, the larger result set won’t be cached. – query_cache_min_res_unit – Query cache allocate memory blocks with the minimum size set by this variable. When the application has a lot of queries with small results, default block size (4 KB) may lead to memory fragmentation. So, with small resultsets, decreasing it to 2048 or 1024 bytes might improve perform- ance; with large query resultsets, increase it to be 8192, 16384 or more, may speed up the performance. – query_cache_type – 0=OFF, 1=ON • MySQL Innodb only memory-related variables – innodb_buffer_pool_size – Set the amount of memory allocated to both Innodb data and index buffer cache. MySQL doesn’t access the disk directly; instead, it reads data into the internal buffer cache, read/write blocks, and flushes the changes back to the disk. If the server requests data available in the cache, the data can be processed right away. Otherwise, the operating system will request that the data be loaded from the disk. The bigger the cache size, the more disk accesses can be avoided. For the sysbench I/O bound workload test on the T2000 server with 8 GB RAM, increasing innodb_buffer_pool_size from 4 GB to 5 GB can improve performance by around 11 percent.
  • 14. 12 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. – innodb_additional_mem_pool_size – Sets the amount of memory allocated to the buffer storing the InnoDB internal data dictionary and other internal data structures. This parameter does not affect performance much, so set it as 20M (in the application with more tables, more memory needs to be allocated here) in the sysbench OLTP test case. – innodb_log_buffer_size – Set the amount of memory allocated to the buffer storing InnoDB write-ahead log entries. For large transactions, before the log buffer is flushed on each transaction commit, if your setting innodb_flush_log_at_trx_commit is at 1, the log can be loaded into the log buffer instead of flushing to the disk in the background to reduce the disk I/O. If you see large log I/O in the show innodb status output at runtime, you probably need to set a larger value for the innodb_log_buffer_size parameter. Since the sysbench OLTP I/O bound workload doesn’t have long transactions, it is not necessary to waste memory resources by setting a higher value for the log buffer, so just set it as 8 MB. • Other MySQL Innodb variables impacting I/O performance – innodb_flush_log_at_trx_commit – InnoDB flushes the transaction log to disk approximately once per second in the background. As a default, innodb_flush_log_at_trx_commit is set as 1 to flush the log to the disk on each transaction commit, which is the safest way avoiding transaction loss during MySQL, OS, or HW crash. For workloads running with many short transactions, you can reduce disk writing by setting the innodb_flush_log_at_trx_commit parameter with different values. When setting this value at 0, there is no log flushing on each transaction commit. It can reduce the disk I/O to improve performance, however, the transaction might be lost if MySQL crashes. – innodb_flush_log_at_trx_commit =0 – In the read-only test, this can improve performance by 4 percent. When setting this value at 2, the log flushes to the OS cache (file system cache) instead of the disk on each transaction commit. It can also reduce the disk I/O and perform a little slower than when the value is set at 0; however, no transaction loss will probably occur with OS or hardware crashes). – innodb_log_file_size – InnoDB writes to the log files in a circular fashion, so if the log file has reached the configure limit set by the innodb_log_file_size parameter, the checkpoint operation is executed at once to flush the modified database pages. innodb_log_file_size is very important for write-intensive workloads, especially for large data sets. Larger sizes reduces disk I/O in checkpointing for better performance but increase recovery times. You will need to increase this parameter when you see large page writes in the BUFFER POOL AND MEMORY part of the show innodb status output.
  • 15. 13 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Optimize File Systems The files system is the next part of the pipeline to optimize. Based on the MySQL storage engine that was selected, I/O types, this will affect how the files system should be configured to eliminate double buffering and disk flushing. • Sync the file systems I/O engine read/write options – File system performance has a big impact on the overall system performance, particularly when running I/O bound workloads with a database size much bigger than system memory. How to configure the file system for better performance is dependent on the workload access pattern—random or sequential. For sequential workload, we can increase the file system cluster size to allow reading ahead or writing back more data from/to the disk to reduce the total number of I/O operations. For random work- load, we can reduce the file system cluster size to match the innodb I/O size. • Reduce double buffers and flushes to disk – Review the buffering model of the MySQL I/O storage engine to remove double buffing. This typically occurs when both the file’s system and the I/O engine are caching data. This causes extra memory moves and uses extra CPU cycles. Before MySQL 5.0.42 and 5.1.18, it needs to mount UFS with forcedirectio option. For the later MySQL 5.0.x and 5.1.x, the directio can be enabled in my.cnf by setting innodb_flush_method as O_DIRECT. Benchmark and Adjust The final step is to put it all together and make any final adjustments. Using the baseline we establish, run the same tests to measure your improvements. Some additional tweaking may be required, but this process will help ensure that you get the most out the Sun MySQL bundle.
  • 16. 14 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Appendix A – An Optimization Benchmark MySQL Sysbench Benchmark Configuration Hardware Installed Host server type Sun Fire X4100 M2 server CPU: 4 x 2793 MHz Memory: 7680 MB Storage model StorageTek 2530 RAID level 5 Disk drives Twelve 73 Gb 15K SAS Storage connectivity (Fiber Channel, SAS SAS, SATA, iSCSI) Number of storage groups/host One Number of storage controllers Two HBA model PCI-X SAS Host Bus Adapter StorageTek 2530 configuration Use the default storage CAMS profile for configuring the volume with RAID level 5, we used the default segment size (512 KB) and enable read-ahead mode. Software Installation Host OS X4100 M2 server: Solaris OS 10 06/06 MySQL Database Server 5.0.45 Test applications sysbench MySQL database server installation steps: • shell> cd /usr/local • shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - • shell> ln -s full-path-to-mysql-VERSION-OS mysql • shell> cd mysql • shell> scripts/mysql_install_db • shell> chmod -R 777 * • shell> bin/mysqld_safe --user=mysql & Sysbench test installation steps: • shell> cd /sysbench-version • shell> ./configure • shell> make • shell> make install Command to Load 100M-row test database: • shell> sysbench –test=oltp –oltp-table-size=100000000 –mysql-db=sbtest100m – max-requests=0 prepare
  • 17. 15 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Sysbench Benchmarks for X4100 M2 and StorageTek 2530 MySQL Sysbench OLTP I/O Bound Test on Sun Fire X4100 M2 server with StorageTek 2530 32 User Read-Only Test Results Sysbench OLTP I/O bound read-only Test with 32 user connections on X4100 M2. The chart above shows the MySQL performance improvement after tuning the innodb data and index buffer size, tuning Solaris UFS with maxcontig settings, and directio. Sysbench OLTP I/O bound read-only test with 2-256 user connections on X4100 M2. # of user connections Trans/Sec 2 104.73 4 251.33 8 451.56 16 555.64 32 577.96 64 563.84 128 558.66 256 519.96
  • 18. 16 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. 32 User Read/Write Test Results Sysbench OLTP I/O bound read-write Test with 32 user connections on X4100 M2. Sysbench OLTP I/O bound read-only Test with 2-256 user connections on X4100 M2. # of user connections Trans/Sec 2 146.04 4 232.05 8 291.1 16 289.12 32 288.51 64 297.32 128 295.32 256 273.91
  • 19. 17 Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. MySQL Settings for Benchmarks [mysqld] port = 3306 socket = /tmp/mysql.sock basedir = /usr/local/mysql datadir = /usr/local/mysql/data log-error = /data/error.txt user=root skip-locking max_connections = 3000 table_cache = 1024 max_allowed_packet = 1M sort_buffer_size = 64K thread_cache = 8 thread_concurrency = 16 query_cache_size = 0M query_cache_type = 0 default-storage-engine = innodb transaction_isolation = REPEATABLE-READ tmp_table_size = 1M innodb_data_file_path = ibdata1:100M:autoextend innodb_buffer_pool_size = 5500M innodb_additional_mem_pool_size = 20M innodb_log_file_size =1900M innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit =1 innodb_lock_wait_timeout = 300 innodb_max_dirty_pages_pct = 90 innodb_thread_concurrency =16
  • 20. Sun and MySQL Solution Bundle Optimization Guide Sun Microsystems, Inc. Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 USA Phone 1-650-960-1300 or 1-800-555-9SUN (9786) Web sun.com © 2008 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems, the Sun logo, Sun Fire, StorageTek, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Information subject to change without notice. SunWIN #522027 02/08