본문 바로가기

컴퓨터/노트북/인터넷

IT 컴퓨터 기기를 좋아하는 사람들의 모임방

조회 수 45 추천 수 0 댓글 0

단축키

Prev이전 문서

Next다음 문서

수정 삭제

단축키

Prev이전 문서

Next다음 문서

수정 삭제
Extra Form

Best Practices for MySQL with SSDs  Page 1  Best Practices for MySQL with SSDs 	 	 	 	 	 	 	 A	whitepaper	by:	 Vijay Balakrishnan  Changho Choi  Veronica Lagrange  Hubbert Smith  Samsung Semiconductor, Inc. Best Practices for MySQL with SSDs  Page 2  Table of Contents 1.  Introduction ....................................................................................................................................... 3  2.  Hardware Configurations .................................................................................................................. 3  3.  Optimizing MySQL Server and Percona Server for SSDs ................................................................... 5  4.  Flush Method and Buffer Pool ........................................................................................................... 6  5.  Impact of Latency .............................................................................................................................. 6  6.  Optimization Guidelines .................................................................................................................... 7  7.  Performance Results Comparison ..................................................................................................... 8  8.  tpcc‐mysql System Resource Utilization.......................................................................................... 11  9.  Conclusions ...................................................................................................................................... 12  10.  Appendix A: MySQL and Percona Configurations ........................................................................... 12     Best Practices for MySQL with SSDs  Page 3  1. Introduction Imagine a world where networking speeds became mired  at 1MB/s, stayed “stuck” at that  speed for 20 years and then became “unstuck,”  suddenly jumping to 1GB/s (1000X).  For  storage, something similar has indeed happened with the transition from Hard Disk Drives  (HDDs) to Solid State Devices (SSDs).  In the past, storage administrators sized systems by  estimating the IOPS needed, then buying a quantity of 15K rpm HDDs to provide those IOPS.  Often, this resulted in buying more HDD capacity than was necessary.  Now, storage  administrators typically size a system based on the needed capacity, then buy a quantity of SSDs  to provide that capacity, and are pleasantly surprised with the performance that comes along  with the capacity. This paper underscores that all SSDs are not alike and that specific  configurations and settings need to be considered to maximize performance and system value.  In the software domain, MySQL Server is a commonly used Relational Database Management  System (RDBMS).This whitepaper clarifies how today's data centers combine SSDs and MySQL to  achieve a substantial business advantage. The paper focuses on Percona Server – a free, fully  compatible, open source MySQL Server enhancement. Because Percona Server is optimized for  the I/O subsystem, it was selected for the experiments herein described, with the best known  methods reported on the following pages.  About the Benchmark: TPC‐C and tpcc‐mysql TPC‐C is an OLTP industry standard benchmark developed and maintained by the Transaction  Processing Performance Council (TPC) [www.tpc.org]. It is widely used and well understood,  which enables database administrators to quickly correlate quoted TPC‐C results to their specific  application. TPC‐C simulates a wholesale supplier and is centered on processing orders. It is a  mixture of read‐only and update‐intensive transactions that represent complex OLTP application  activities. The benchmark implements five types of transactions (new order, payment, delivery,  order status and stock level), and reports performance by measuring the number of new orders  processed per minute (tpmC). It contains strict guidelines that must be observed in any official  implementation. Furthermore, in spite of its complexity, TPC‐C is easily scaled up or down to fit  the system under test.  Tpcc‐mysql is Percona’s TPC‐C implementation. It is written in C and follows Revision 5.11 of the  MySQL standard specification.  We tested with tpcc‐mysql “out‐of‐the box” code, downloaded  from the Percona GitHub site.   2. Hardware Configurations In the past, OLTP systems were frequently bottlenecked by IO, meaning CPUs were constantly  waiting on HDDs to respond.  But when we replace HDDs with NVMe SSDs on a Dual Socket Best Practices for MySQL with SSDs  Page 4  Server, the CPU becomes the bottleneck. In an attempt to minimize the CPU bottleneck,  we  tested two types of database servers: Dual Socket (12 core) and Quad socket (28 core).  Dual‐socket (12 Core) configuration  Database Server  (Client) Load Generation Server  CPU  Model Name  Intel(R) Xeon(R) CPU E5‐2670 v3 @  2.30GHz  Intel(R) Xeon(R) CPU E5‐2640 v3 @ 2.60GHz  Processors  12  8  Cores  24  32  Memory  64GB  128GB  OS version  Linux 4.4.0‐040400‐generic   Linux 3.19.0‐14‐generic  MySQL Server  5.7.11  Percona Server  5.7.10‐3  Storage        SAS HDD  2x SEAGATE  ST600MP0005 15K  rpm    SATA SSD  2x Samsung 850 PRO     NVMe SSD  2x Samsung XS1715         Quad‐socket (28 Core) Configuration     Database Server  (Client) Load Generation Server  CPU     Model Name  Intel(R) Xeon(R) CPU E7‐4850 v3 @ 2.20GHz  Intel(R) Xeon(R) CPU E5‐2640 v3 @ 2.60GHz  Processors  28  8  Cores  112  32  Memory   124GB   126GB  OS version  Linux 4.4.0‐040400‐generic   Linux 3.19.0‐14‐generic  Percona Server  5.7.11‐4     Storage        SAS HDD  2x SEAGATE  ST600MP0005 15K rpm    SATA SSD  2x Samsung 850 Pro     SAS SSD  2x Samsung PM1633  NVMe  2x Samsung PM1725     It is generally accepted that OLTP database applications have been I/O bound. They typically  have not exhausted CPU capacity. While this is true for HDDs, we see a paradigm shift with  NVMe SSDs.  Best Practices for MySQL with SSDs  Page 5  With HDDs, CPUs are always less than 1% busy, while with NVMe SSDs CPU utilization goes up  to more than 30% with 100+ connections. This 30 times CPU increase translates into 110+ times  more transactions per minute (tpmP), making the case for better server utilization when using  NVMe SSDs.  Mean CPU % utilization (User+Sys) on the Quad Socked Server  Mean CPU %  15K rpm  SAS‐HDD  SATA SSD  SAS SSD  NVMe SSD  50 connections  0.4%  5.8%  15.9%  22.3%  100 connections  0.4%  13.4%  23.3%  32.1%  150 connections  0.5%  15.0%  26.4%  28.9%  200 connections  N A  16.4%  27.2%  33.8%  This report presents current results for four storage devices: PM1725 (NVMe SSD), PM1633 (SAS  SSD), 850Pro (SATA SSD), and a Seagate 15Krpm HDD (HDD). We show how faster SSD storage is  revolutionizing typical OLTP applications that have been traditionally I/O bound, thereby  increasing throughput by orders of magnitude, measured with tpcc‐mysql benchmark. 3. Optimizing MySQL Server and Percona Server for SSDs We observed that the NVMe SSDs performed either 200% or 700% better than SATA SSDs,  depending on the selected configuration. With that in mind, we then proceeded to determine  the best performance level for each device. In addition to adjusting MySQL configuration  parameters, we tried increasing and decreasing the database sizei , as well as partitioning  (sharding) the database across multiple storage volumes.   MySQL Server throughput (tpmP1 ) for 200 and 250 connections ‐ SATA versus NVMe on the Dual Socket Server  1,000‐wh23; 200‐connections  SATA SSD  NVMe SSD  pct diff  Config #1 – MySQL baseline        7,366.55      24,440.57  232%  Config #2 – sub‐optimal config        4,478.28      37,802.13  744%  pct diff  ‐39%  55%     1,000‐wh; 250‐connections  SATA  NVMe  pct diff  Config #1 – MySQL baseline        6,668.33      23,175.19  248%  Config #2‐ sub‐optimal config        4,457.47      33,857.05  660%  pct diff  ‐33%  46%                                                                  1  tpmP= New Order transactions per minute  2  TPC‐C database size is defined by number of warehouses (wh). All tables are scaled up or down based on the  number of warehouses defined. A 10‐wh database occupies roughly 1GB of disk space. Best Practices for MySQL with SSDs  Page 6  BKM  Use SSDs instead of HDDs; there is no viable reason to use HDDs.  First preference: NVMe SSD  Second preference: SAS SSD  4. Flush Method and Buffer Pool BKM  Switch the flush_method to ‘O_DIRECT’  MySQL uses its buffer pool as disk cache, rather than using Linux filesystem as buffer  space.  BKM  Increase the buffer pool from 3GB to 12GB  Larger buffer pool improves performance for all storage types.  After considerable experimentation and analysis, we switched the flush_method to ‘O_DIRECT’,  and then stopped using Linux’s filesystem buffer space and instead began using MySQL buffer  pool as the disk cache.  Configuration #2 (sub‐optimal, see appendix A) has 3GB of buffer pool,  and therefore very little buffer space to be spared as disk cache.   In Configuration #3 (MySQL Optimal, see appendix A) we increased the buffer pool to 12GB,  which benefitted all three storage types.   The NA for 15K rpm SAS‐HDD in Configuration #2 (sub‐optimal) indicates we cannot run tpcc‐ mysql with that setup (we get “lock wait timeout” error messages, meaning that the system is  not able to complete transactions within the expected time). When we move to Configuration  #3 (MySQL optimal), we get a significant boost for all devices, especially for 15K rpm SAS‐HDD,  which is now able to complete the test without errors.  5. Impact of Latency Think of latency as a traffic signal on a popular roadway. If the roadway has few cars, it’s an  inconvenience. If the roadway has too many cars, traffic backs up which can be a disaster; this is  true in I/O.  This is when data center managers can really appreciate the benefits of faster  storage devices. When everything else is the same, most users connected to an “NVMe system”  will see their transactions completed in less than 90 milliseconds – two orders of magnitude  faster than the 5,000+ milliseconds users connected to the “HDD system” experience. Best Practices for MySQL with SSDs  Page 7  MySQL Server 95th percentile response times for Config #3 (dual socket)  MySQL Server maximum response times for Config #3 (dual socket) In the case of SAS‐HDD with 150 connections, the I/O traffic backs up and the system becomes  unresponsive. If this happens in an actual market environment, anyone using the database  (bank tellers, cash registers, RFID checkers) will see their transactions cease to operate and their  business grind to a halt.  6. Optimization Guidelines BKM  innodb_thread_concurrency. Different values were tried; the best performance came with  the default 0 (unlimited thread_concurrency).  50 c 100 c 150 c sas‐hdd 6,329.74 5,288.26 sata 1,066.15 1,188.02 1,191.95 nvme 36.86 54.22 85.61  ‐  1,000.00  2,000.00  3,000.00  4,000.00  5,000.00  6,000.00  7,000.00 milliseconds 95th percentile Response Time ‐ New Order 50 c 100 c 150 c sas‐hdd 20,300.16 49,452.06 sata 4,699.63 15,759.15 37,367.16 nvme 1,716.82 1,242.70 1,932.78  ‐  10,000.00  20,000.00  30,000.00  40,000.00  50,000.00  60,000.00 milliseconds Maximum Response Time ‐ New OrderBest Practices for MySQL with SSDs  Page 8  BKM  innodb_adaptive_hash_index. Turned ‘OFF’, since OLTP workloads typically do not reuse  data from previous queries.  BKM  innodb_fill_factor. Indicates the percentage of space on each B‐tree page that is filled  during a sorted index build. 50 works best for workloads with lots of INSERTs.  BKM  Separate log_dir and datadir. All storage types benefit from this. For both Percona and  MySQL Server, it means setting up the parameters from Appendix A marked with either  <data storage> or <log storage> to the appropriate storage location.  7. Performance Results Comparison Here throughput results for all storage types were reviewed. Observe that the SATA SSD result is  32+ times better than that of the HDD, and that NVMe SSD throughput is two to five times  better than SATA, and up to 51% better than SAS SSD.  Throughput in tpmP – Quad Socket  Connec tions SAS‐ HDD  SATA  SSD  SAS  SSD  NVMe  SSD  SAS_HDD  ‐> SATA  SAS_HDD ‐>  SAS‐SSD  SAS_HDD ‐ > NVMe  SATA  ‐ > SAS  SATA ‐>  NVMe  SAS‐>  NVMe  50  742  23,868  73,236  110,357  3117%  9770%  14773%  207%  362%  51%  100  757  55,378  94,702  136,479  7218%  12415%  17935%  71%  146%  44%  150  1,090  58,123  96,691  138,748  5234%  8773%  12632%  66%  139%  43%  200  N A  58,276  97,796  139,158           68%  139%  42%  The best tpcc‐mysql throughput, 139K tpmP, is obtained using NVMe SSDs running with 200  connections. The 100 connection result, 136K tpmP, is 180+ times better than HDD. Next figure  shows New Order transactions executed over time for all four storage types for the 100‐ connection case.     Best Practices for MySQL with SSDs  Page 9  New Order transactions over time (Higher is better)  New Order 95th percentile response times (Lower is better)  Notice for 15K SAS‐HDD 200c, the result took too long to obtain (failed test). In an actual  market environment, this represents a non‐responsive system impacting business  operations.      0 50000 100000 150000 200000 60 540 1020 1500 1980 2460 2940 3420 3900 4380 4860 5340 5820 6300 6780 Time interval NewOrder Transactions per Minute ‐ 100  Connections nvme SAS sata sas‐hdd 50 c 100 c 150 c 200 c sas‐hdd 4,182 8,572 10,847 sata 100 142 181 239 SAS 57 68 128 145 nvme 26 32 33 34  ‐  2,000  4,000  6,000  8,000  10,000  12,000 milliseconds Connections NewOrder 95th Percentile Response TimesBest Practices for MySQL with SSDs  Page 10  New Order maximum response times (Lower is better)  The 95th percentile response times for New Order transactions over the duration of each  measurement.  SATA SSD and SAS SSD latencies (Lower is better)  SAS SSDs demonstrate significantly lower latencies than SATA SSD for this OLTP  workload.  50 c 100 c 150 c 200 c sas‐hdd 13,884 42,896 76,668 sata 592 899 1,243 1,483 SAS 286 454 1,148 1,759 nvme 219 343 401 528  ‐  10,000  20,000  30,000  40,000  50,000  60,000  70,000  80,000  90,000 milliseconds Connections NewOrder Maximum Response Times 0 50 100 150 200 120 480 840 1200 1560 1920 2280 2640 3000 3360 3720 4080 4440 4800 5160 5520 5880 6240 6600 6960 milliseconds time interval NewOrder 95th Percentile Response Time ‐ 100 connections sata SASBest Practices for MySQL with SSDs  Page 11  SAS and NVMe latencies (Lower is better)  NVMe SSDs demonstrate significantly lower latencies than SAS SSDs for this OLTP workload.  8. tpcc‐mysql System Resource Utilization All Disk Writes 100 connections (Higher is better)  0 10 20 30 40 50 60 70 80 90 120 480 840 1200 1560 1920 2280 2640 3000 3360 3720 4080 4440 4800 5160 5520 5880 6240 6600 6960 milliseconds time interval NewOrder 95th Percentile Response Time ‐ 100 Connections SAS nvmeBest Practices for MySQL with SSDs  Page 12  All Disk Reads 100 connections (Higher is better)  9. Conclusions Not all SSDs are the same but all SSDs perform substantially better than HDDs.  NVMe SSDs can  be up to five times more performant than SATA SSDs, as tested with Percona.  SAS‐SSD can be  up to 125 more performant than SAS‐HDD. NVMe SSDs are 180 times more performant than  15K rpm HDDs.  10. Appendix A: MySQL and Percona Configurations This appendix contains the many configuration settings for both MySQL Server and Percona Server  discussed in this report.  MySQL Server and Percona Server configurations  Parameter Name  Config #1 MySQL Initial  Config #2 MySQL  Suboptimal  Config #3  MySQL  Optimal  Config #4 Percona  Optimal  datadir  /<data  storage>/mysql_data/mysql     tmpdir    /tmp  /<log  storage>/mysql_log  lc‐messages‐dir   /usr/share/mysql    explicit_defaults_for_timestamp       innodb_log_group_home_dir   /<log storage>/mysql_log   Best Practices for MySQL with SSDs  Page 13  innodb_undo_directory   /<log storage>/mysql_log    innodb_buffer_pool_size   3GB  12GB  innodb_thread_concurrency  0 innodb_temp_data_file_path   '../../../<log  storage>/mysql_log/ibtmp1:72 M:autoextend'  innodb_page_cleaners 32    8 innodb_buffer_pool_instances 32    8 innodb_io_capacity 300000    15,000  innodb_io_capacity_max  600000    25,000 innodb_adaptive_hash_index OFF'     0 innodb_fill_factor 50    100 innodb_write_io_threads 16 innodb_read_io_threads 16 innodb_flush_method <empty>  O_DIRECT O_DIRECT  O_DIRECT innodb_flush_neighbors 1    0 query_cache_size 0 log_timestamps  'SYSTEM'  table_open_cache 8000 table_open_cache_instances 16    64 back_log 1500 max_connections 4000 innodb_use_native_io  ON (default)    OFF / ON ## To be able to use many  connections in TPC‐C:    max_prepared_stmt_count 64000 # files    innodb_log_files_in_group 3 innodb_log_file_size 48MB  1G 1G  10G innodb_open_files 4000    # tune =     innodb_checksum_algorithm NONE  crc32 innodb_max_dirty_pages_pct 90    innodb_max_dirty_pages_pct_lwm 10    innodb_lru_scan_depth 4000 8192 join_buffer_size 32K     sort_buffer_size 32K     innodb_spin_wait_delay 96 6 # perf special       innodb_flush_neighbors 0   Best Practices for MySQL with SSDs  Page 14  innodb_max_purge_lag_delay 30000000 0 # Monitoring       innodb_monitor_enable  '%'  <empty> performance_schema OFF     ..oo0oo..                                                               i  TPC‐C database size is defined by number of warehouses (wh). All tables are scaled up or down based on the  number of warehouses defined. A 10‐wh database occupies roughly 1GB of disk space. 

 

best-practices-for-mysql-with-ssds_2.jpg

 

best-practices-for-mysql-with-ssds_3.jpg

 

best-practices-for-mysql-with-ssds_4.jpg

 

best-practices-for-mysql-with-ssds_5.jpg

 

best-practices-for-mysql-with-ssds_6.jpg

 

best-practices-for-mysql-with-ssds_7.jpg

 

best-practices-for-mysql-with-ssds_8.jpg

 

best-practices-for-mysql-with-ssds_9.jpg

 

best-practices-for-mysql-with-ssds_10.jpg

 

best-practices-for-mysql-with-ssds_11.jpg

 

best-practices-for-mysql-with-ssds_12.jpg

 

best-practices-for-mysql-with-ssds_13.jpg

 

Best Practices for MySQL with SSDs  Page 1  Best Practices for MySQL with SSDs 	 	 	 	 	 	 	 A	whitepaper	by:	 Vijay Balakrishnan  Changho Choi  Veronica Lagrange  Hubbert Smith  Samsung Semiconductor, Inc. Best Practices for MySQL with SSDs  Page 2  Table of Contents 1.  Introduction ....................................................................................................................................... 3  2.  Hardware Configurations .................................................................................................................. 3  3.  Optimizing MySQL Server and Percona Server for SSDs ................................................................... 5  4.  Flush Method and Buffer Pool ........................................................................................................... 6  5.  Impact of Latency .............................................................................................................................. 6  6.  Optimization Guidelines .................................................................................................................... 7  7.  Performance Results Comparison ..................................................................................................... 8  8.  tpcc‐mysql System Resource Utilization.......................................................................................... 11  9.  Conclusions ...................................................................................................................................... 12  10.  Appendix A: MySQL and Percona Configurations ........................................................................... 12     Best Practices for MySQL with SSDs  Page 3  1. Introduction Imagine a world where networking speeds became mired  at 1MB/s, stayed “stuck” at that  speed for 20 years and then became “unstuck,”  suddenly jumping to 1GB/s (1000X).  For  storage, something similar has indeed happened with the transition from Hard Disk Drives  (HDDs) to Solid State Devices (SSDs).  In the past, storage administrators sized systems by  estimating the IOPS needed, then buying a quantity of 15K rpm HDDs to provide those IOPS.  Often, this resulted in buying more HDD capacity than was necessary.  Now, storage  administrators typically size a system based on the needed capacity, then buy a quantity of SSDs  to provide that capacity, and are pleasantly surprised with the performance that comes along  with the capacity. This paper underscores that all SSDs are not alike and that specific  configurations and settings need to be considered to maximize performance and system value.  In the software domain, MySQL Server is a commonly used Relational Database Management  System (RDBMS).This whitepaper clarifies how today's data centers combine SSDs and MySQL to  achieve a substantial business advantage. The paper focuses on Percona Server – a free, fully  compatible, open source MySQL Server enhancement. Because Percona Server is optimized for  the I/O subsystem, it was selected for the experiments herein described, with the best known  methods reported on the following pages.  About the Benchmark: TPC‐C and tpcc‐mysql TPC‐C is an OLTP industry standard benchmark developed and maintained by the Transaction  Processing Performance Council (TPC) [www.tpc.org]. It is widely used and well understood,  which enables database administrators to quickly correlate quoted TPC‐C results to their specific  application. TPC‐C simulates a wholesale supplier and is centered on processing orders. It is a  mixture of read‐only and update‐intensive transactions that represent complex OLTP application  activities. The benchmark implements five types of transactions (new order, payment, delivery,  order status and stock level), and reports performance by measuring the number of new orders  processed per minute (tpmC). It contains strict guidelines that must be observed in any official  implementation. Furthermore, in spite of its complexity, TPC‐C is easily scaled up or down to fit  the system under test.  Tpcc‐mysql is Percona’s TPC‐C implementation. It is written in C and follows Revision 5.11 of the  MySQL standard specification.  We tested with tpcc‐mysql “out‐of‐the box” code, downloaded  from the Percona GitHub site.   2. Hardware Configurations In the past, OLTP systems were frequently bottlenecked by IO, meaning CPUs were constantly  waiting on HDDs to respond.  But when we replace HDDs with NVMe SSDs on a Dual Socket Best Practices for MySQL with SSDs  Page 4  Server, the CPU becomes the bottleneck. In an attempt to minimize the CPU bottleneck,  we  tested two types of database servers: Dual Socket (12 core) and Quad socket (28 core).  Dual‐socket (12 Core) configuration  Database Server  (Client) Load Generation Server  CPU  Model Name  Intel(R) Xeon(R) CPU E5‐2670 v3 @  2.30GHz  Intel(R) Xeon(R) CPU E5‐2640 v3 @ 2.60GHz  Processors  12  8  Cores  24  32  Memory  64GB  128GB  OS version  Linux 4.4.0‐040400‐generic   Linux 3.19.0‐14‐generic  MySQL Server  5.7.11  Percona Server  5.7.10‐3  Storage        SAS HDD  2x SEAGATE  ST600MP0005 15K  rpm    SATA SSD  2x Samsung 850 PRO     NVMe SSD  2x Samsung XS1715         Quad‐socket (28 Core) Configuration     Database Server  (Client) Load Generation Server  CPU     Model Name  Intel(R) Xeon(R) CPU E7‐4850 v3 @ 2.20GHz  Intel(R) Xeon(R) CPU E5‐2640 v3 @ 2.60GHz  Processors  28  8  Cores  112  32  Memory   124GB   126GB  OS version  Linux 4.4.0‐040400‐generic   Linux 3.19.0‐14‐generic  Percona Server  5.7.11‐4     Storage        SAS HDD  2x SEAGATE  ST600MP0005 15K rpm    SATA SSD  2x Samsung 850 Pro     SAS SSD  2x Samsung PM1633  NVMe  2x Samsung PM1725     It is generally accepted that OLTP database applications have been I/O bound. They typically  have not exhausted CPU capacity. While this is true for HDDs, we see a paradigm shift with  NVMe SSDs.  Best Practices for MySQL with SSDs  Page 5  With HDDs, CPUs are always less than 1% busy, while with NVMe SSDs CPU utilization goes up  to more than 30% with 100+ connections. This 30 times CPU increase translates into 110+ times  more transactions per minute (tpmP), making the case for better server utilization when using  NVMe SSDs.  Mean CPU % utilization (User+Sys) on the Quad Socked Server  Mean CPU %  15K rpm  SAS‐HDD  SATA SSD  SAS SSD  NVMe SSD  50 connections  0.4%  5.8%  15.9%  22.3%  100 connections  0.4%  13.4%  23.3%  32.1%  150 connections  0.5%  15.0%  26.4%  28.9%  200 connections  N A  16.4%  27.2%  33.8%  This report presents current results for four storage devices: PM1725 (NVMe SSD), PM1633 (SAS  SSD), 850Pro (SATA SSD), and a Seagate 15Krpm HDD (HDD). We show how faster SSD storage is  revolutionizing typical OLTP applications that have been traditionally I/O bound, thereby  increasing throughput by orders of magnitude, measured with tpcc‐mysql benchmark. 3. Optimizing MySQL Server and Percona Server for SSDs We observed that the NVMe SSDs performed either 200% or 700% better than SATA SSDs,  depending on the selected configuration. With that in mind, we then proceeded to determine  the best performance level for each device. In addition to adjusting MySQL configuration  parameters, we tried increasing and decreasing the database sizei , as well as partitioning  (sharding) the database across multiple storage volumes.   MySQL Server throughput (tpmP1 ) for 200 and 250 connections ‐ SATA versus NVMe on the Dual Socket Server  1,000‐wh23; 200‐connections  SATA SSD  NVMe SSD  pct diff  Config #1 – MySQL baseline        7,366.55      24,440.57  232%  Config #2 – sub‐optimal config        4,478.28      37,802.13  744%  pct diff  ‐39%  55%     1,000‐wh; 250‐connections  SATA  NVMe  pct diff  Config #1 – MySQL baseline        6,668.33      23,175.19  248%  Config #2‐ sub‐optimal config        4,457.47      33,857.05  660%  pct diff  ‐33%  46%                                                                  1  tpmP= New Order transactions per minute  2  TPC‐C database size is defined by number of warehouses (wh). All tables are scaled up or down based on the  number of warehouses defined. A 10‐wh database occupies roughly 1GB of disk space. Best Practices for MySQL with SSDs  Page 6  BKM  Use SSDs instead of HDDs; there is no viable reason to use HDDs.  First preference: NVMe SSD  Second preference: SAS SSD  4. Flush Method and Buffer Pool BKM  Switch the flush_method to ‘O_DIRECT’  MySQL uses its buffer pool as disk cache, rather than using Linux filesystem as buffer  space.  BKM  Increase the buffer pool from 3GB to 12GB  Larger buffer pool improves performance for all storage types.  After considerable experimentation and analysis, we switched the flush_method to ‘O_DIRECT’,  and then stopped using Linux’s filesystem buffer space and instead began using MySQL buffer  pool as the disk cache.  Configuration #2 (sub‐optimal, see appendix A) has 3GB of buffer pool,  and therefore very little buffer space to be spared as disk cache.   In Configuration #3 (MySQL Optimal, see appendix A) we increased the buffer pool to 12GB,  which benefitted all three storage types.   The NA for 15K rpm SAS‐HDD in Configuration #2 (sub‐optimal) indicates we cannot run tpcc‐ mysql with that setup (we get “lock wait timeout” error messages, meaning that the system is  not able to complete transactions within the expected time). When we move to Configuration  #3 (MySQL optimal), we get a significant boost for all devices, especially for 15K rpm SAS‐HDD,  which is now able to complete the test without errors.  5. Impact of Latency Think of latency as a traffic signal on a popular roadway. If the roadway has few cars, it’s an  inconvenience. If the roadway has too many cars, traffic backs up which can be a disaster; this is  true in I/O.  This is when data center managers can really appreciate the benefits of faster  storage devices. When everything else is the same, most users connected to an “NVMe system”  will see their transactions completed in less than 90 milliseconds – two orders of magnitude  faster than the 5,000+ milliseconds users connected to the “HDD system” experience. Best Practices for MySQL with SSDs  Page 7  MySQL Server 95th percentile response times for Config #3 (dual socket)  MySQL Server maximum response times for Config #3 (dual socket) In the case of SAS‐HDD with 150 connections, the I/O traffic backs up and the system becomes  unresponsive. If this happens in an actual market environment, anyone using the database  (bank tellers, cash registers, RFID checkers) will see their transactions cease to operate and their  business grind to a halt.  6. Optimization Guidelines BKM  innodb_thread_concurrency. Different values were tried; the best performance came with  the default 0 (unlimited thread_concurrency).  50 c 100 c 150 c sas‐hdd 6,329.74 5,288.26 sata 1,066.15 1,188.02 1,191.95 nvme 36.86 54.22 85.61  ‐  1,000.00  2,000.00  3,000.00  4,000.00  5,000.00  6,000.00  7,000.00 milliseconds 95th percentile Response Time ‐ New Order 50 c 100 c 150 c sas‐hdd 20,300.16 49,452.06 sata 4,699.63 15,759.15 37,367.16 nvme 1,716.82 1,242.70 1,932.78  ‐  10,000.00  20,000.00  30,000.00  40,000.00  50,000.00  60,000.00 milliseconds Maximum Response Time ‐ New OrderBest Practices for MySQL with SSDs  Page 8  BKM  innodb_adaptive_hash_index. Turned ‘OFF’, since OLTP workloads typically do not reuse  data from previous queries.  BKM  innodb_fill_factor. Indicates the percentage of space on each B‐tree page that is filled  during a sorted index build. 50 works best for workloads with lots of INSERTs.  BKM  Separate log_dir and datadir. All storage types benefit from this. For both Percona and  MySQL Server, it means setting up the parameters from Appendix A marked with either  <data storage> or <log storage> to the appropriate storage location.  7. Performance Results Comparison Here throughput results for all storage types were reviewed. Observe that the SATA SSD result is  32+ times better than that of the HDD, and that NVMe SSD throughput is two to five times  better than SATA, and up to 51% better than SAS SSD.  Throughput in tpmP – Quad Socket  Connec tions SAS‐ HDD  SATA  SSD  SAS  SSD  NVMe  SSD  SAS_HDD  ‐> SATA  SAS_HDD ‐>  SAS‐SSD  SAS_HDD ‐ > NVMe  SATA  ‐ > SAS  SATA ‐>  NVMe  SAS‐>  NVMe  50  742  23,868  73,236  110,357  3117%  9770%  14773%  207%  362%  51%  100  757  55,378  94,702  136,479  7218%  12415%  17935%  71%  146%  44%  150  1,090  58,123  96,691  138,748  5234%  8773%  12632%  66%  139%  43%  200  N A  58,276  97,796  139,158           68%  139%  42%  The best tpcc‐mysql throughput, 139K tpmP, is obtained using NVMe SSDs running with 200  connections. The 100 connection result, 136K tpmP, is 180+ times better than HDD. Next figure  shows New Order transactions executed over time for all four storage types for the 100‐ connection case.     Best Practices for MySQL with SSDs  Page 9  New Order transactions over time (Higher is better)  New Order 95th percentile response times (Lower is better)  Notice for 15K SAS‐HDD 200c, the result took too long to obtain (failed test). In an actual  market environment, this represents a non‐responsive system impacting business  operations.      0 50000 100000 150000 200000 60 540 1020 1500 1980 2460 2940 3420 3900 4380 4860 5340 5820 6300 6780 Time interval NewOrder Transactions per Minute ‐ 100  Connections nvme SAS sata sas‐hdd 50 c 100 c 150 c 200 c sas‐hdd 4,182 8,572 10,847 sata 100 142 181 239 SAS 57 68 128 145 nvme 26 32 33 34  ‐  2,000  4,000  6,000  8,000  10,000  12,000 milliseconds Connections NewOrder 95th Percentile Response TimesBest Practices for MySQL with SSDs  Page 10  New Order maximum response times (Lower is better)  The 95th percentile response times for New Order transactions over the duration of each  measurement.  SATA SSD and SAS SSD latencies (Lower is better)  SAS SSDs demonstrate significantly lower latencies than SATA SSD for this OLTP  workload.  50 c 100 c 150 c 200 c sas‐hdd 13,884 42,896 76,668 sata 592 899 1,243 1,483 SAS 286 454 1,148 1,759 nvme 219 343 401 528  ‐  10,000  20,000  30,000  40,000  50,000  60,000  70,000  80,000  90,000 milliseconds Connections NewOrder Maximum Response Times 0 50 100 150 200 120 480 840 1200 1560 1920 2280 2640 3000 3360 3720 4080 4440 4800 5160 5520 5880 6240 6600 6960 milliseconds time interval NewOrder 95th Percentile Response Time ‐ 100 connections sata SASBest Practices for MySQL with SSDs  Page 11  SAS and NVMe latencies (Lower is better)  NVMe SSDs demonstrate significantly lower latencies than SAS SSDs for this OLTP workload.  8. tpcc‐mysql System Resource Utilization All Disk Writes 100 connections (Higher is better)  0 10 20 30 40 50 60 70 80 90 120 480 840 1200 1560 1920 2280 2640 3000 3360 3720 4080 4440 4800 5160 5520 5880 6240 6600 6960 milliseconds time interval NewOrder 95th Percentile Response Time ‐ 100 Connections SAS nvmeBest Practices for MySQL with SSDs  Page 12  All Disk Reads 100 connections (Higher is better)  9. Conclusions Not all SSDs are the same but all SSDs perform substantially better than HDDs.  NVMe SSDs can  be up to five times more performant than SATA SSDs, as tested with Percona.  SAS‐SSD can be  up to 125 more performant than SAS‐HDD. NVMe SSDs are 180 times more performant than  15K rpm HDDs.  10. Appendix A: MySQL and Percona Configurations This appendix contains the many configuration settings for both MySQL Server and Percona Server  discussed in this report.  MySQL Server and Percona Server configurations  Parameter Name  Config #1 MySQL Initial  Config #2 MySQL  Suboptimal  Config #3  MySQL  Optimal  Config #4 Percona  Optimal  datadir  /<data  storage>/mysql_data/mysql     tmpdir    /tmp  /<log  storage>/mysql_log  lc‐messages‐dir   /usr/share/mysql    explicit_defaults_for_timestamp       innodb_log_group_home_dir   /<log storage>/mysql_log   Best Practices for MySQL with SSDs  Page 13  innodb_undo_directory   /<log storage>/mysql_log    innodb_buffer_pool_size   3GB  12GB  innodb_thread_concurrency  0 innodb_temp_data_file_path   '../../../<log  storage>/mysql_log/ibtmp1:72 M:autoextend'  innodb_page_cleaners 32    8 innodb_buffer_pool_instances 32    8 innodb_io_capacity 300000    15,000  innodb_io_capacity_max  600000    25,000 innodb_adaptive_hash_index OFF'     0 innodb_fill_factor 50    100 innodb_write_io_threads 16 innodb_read_io_threads 16 innodb_flush_method <empty>  O_DIRECT O_DIRECT  O_DIRECT innodb_flush_neighbors 1    0 query_cache_size 0 log_timestamps  'SYSTEM'  table_open_cache 8000 table_open_cache_instances 16    64 back_log 1500 max_connections 4000 innodb_use_native_io  ON (default)    OFF / ON ## To be able to use many  connections in TPC‐C:    max_prepared_stmt_count 64000 # files    innodb_log_files_in_group 3 innodb_log_file_size 48MB  1G 1G  10G innodb_open_files 4000    # tune =     innodb_checksum_algorithm NONE  crc32 innodb_max_dirty_pages_pct 90    innodb_max_dirty_pages_pct_lwm 10    innodb_lru_scan_depth 4000 8192 join_buffer_size 32K     sort_buffer_size 32K     innodb_spin_wait_delay 96 6 # perf special       innodb_flush_neighbors 0   Best Practices for MySQL with SSDs  Page 14  innodb_max_purge_lag_delay 30000000 0 # Monitoring       innodb_monitor_enable  '%'  <empty> performance_schema OFF     ..oo0oo..                                                               i  TPC‐C database size is defined by number of warehouses (wh). All tables are scaled up or down based on the  number of warehouses defined. A 10‐wh database occupies roughly 1GB of disk space. 

 


컴퓨터/노트북/인터넷

IT 컴퓨터 기기를 좋아하는 사람들의 모임방

List of Articles
번호 분류 제목 조회 수 날짜
공지 뉴스 구글 최신 뉴스 file 1454 2024.12.12
HOT글 일반 샤오미 BE6500 라우터 실사용 후기 (Wi-Fi 7 + 2.5G 스위치 기능까지 ㄷㄷ) 4 1016 2025.06.28
공지 🚨(뉴비필독) 전체공지 & 포인트안내 20 28833 2024.11.04
공지 URL만 붙여넣으면 끝! 임베드 기능 22954 2025.01.21
10641 정보 `보안` 차별성 강조하는 애플…이번엔 M1 맥에 보안 최강 - 매일경제 - 매일경제 726 2021.02.21
10640 일반 ? 페어폰? file 63 2022.03.03
10639 일반 ???: RTX 50이 전작보다 전기를 더먹는다고..? file 75 2024.09.07
10638 일반 ???: 핫딜 올려봐~~~ 108 2022.02.09
10637 .2Ghz에 도달한 AMD Ryzen 7 2700X 샘플 포착 126 2018.04.02
10636 일반 .Android 8.0 오레오의 신기술은 어떤것이 있을까 81 2017.08.24
10635 일반 .Android 8.0 오레오의 신기술은 어떤것이 있을까 94 2017.08.24
10634 .exe 파일을 추출 하는 프로그램 2 487 2019.01.25
10633 일반 .exe 파일을 추출 하는 프로그램 495 2023.03.27
10632 정보 'LG V30' 출시 색상 암시? LG전자, 새로운 티저 공개(영상) 99 2017.08.23
10631 일반 '지원 종료' 윈도 서버 2003 사용 기업을 위한 2가지 조언 747 2015.07.20
10630 정보 ‘180억 매출’ 용산 전자업체 (컴퓨리) 파산 file 217 2024.10.21
10629 일반 ‘30TB 벽’ 깬 32TB 하드 등장…소비자용 디스크 시대 저무는 이유 208 2024.10.21
10628 정보 ‘갤럭시S21’을 3만원에?…통신3사, 최대 61만원 불법 지원 - 조선비즈 749 2021.03.01
10627 정보 ‘굿바이 인텔’, 애플 자체 칩셋 탑재 맥북 첫 선 - 국민일보 773 2021.02.21
10626 정보 ‘도둑 시청’ 새 누누티비 문 열었다…OTT 업계 '한숨' 447 2023.06.24
10625 정보 ‘삼성폰 언박싱’ 유튜버의 한탄 “정말 열심히 만들었는데…” [IT선빵!] - 헤럴드경제 뉴스 - 헤럴드경제 1036 2021.03.17
10624 정보 ‘아이폰 위탁생산’ 대만 폭스콘, 전기차 생산 추진 - 동아일보 735 2021.02.22
10623 정보 ‘아이폰12 15만원→갤S21 17만원’ 구매 가격 낮아진다 [IT선빵!] - 헤럴드경제 뉴스 - 헤럴드경제 771 2021.03.17
10622 정보 ‘아이폰12’ 8천만대 공급한다는 애플... 中 만리장성 무사히 넘을까 - 조선비즈 775 2021.02.21
10621 정보 ‘아이폰12’ 분해하니 한국 부품 27%…미국·일본 제치고 1위 - 조선비즈 736 2021.02.21
10620 정보 ‘아이폰13’, ‘노치 디자인·충전 케이블’ 모두 없어질까? 주사율은? - 아주경제 733 2021.03.01
10619 정보 ‘음성SNS’ 인기에 ‘아이폰’ 수요 늘어 - 경향신문 745 2021.02.21
10618 ‘카트라이더 러쉬플러스’, 포르쉐코리아와 e스포츠 제휴 이벤트 진행 19 2021.02.03
10617 정보 ‘클럽하우스’에 ‘번개장터’ 효과?…중고 아이폰8 값 오히려 올랐다 - 중앙일보 - 중앙일보 786 2021.03.01
10616 일반 ‘테라’ 권도형 “싱가포르 있다”더니…현지 사무실 폐쇄 750 2022.12.31
10615 정보 ‘하입비스트’가 확인해본 애플 '맥세이프 듀오 충전기' & '신형 맥북 에어'의 성능은? - HYPEBEAST 720 2021.02.21
10614 일반 "갤럭시S6엣지 플러스, 3000mAh 대용량 배터리 탑재"… 왜? 1083 2015.07.20
10613 정보 “5G는 갤럭시”… 美 다운로드 속도 측정서 아이폰 압도 - 머니S - Money S 993 2021.03.17
10612 정보 “ARM 기반 13인치 맥북 프로·아이맥, 올해 말 나온다” - ZD넷 코리아 734 2021.02.21
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 355 Next
/ 355