본문 바로가기

컴퓨터/노트북/인터넷

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

조회 수 43 추천 수 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 컴퓨터 기기를 좋아하는 사람들의 모임방

  1. 구글 최신 뉴스

    날짜2024.12.12 카테고리뉴스 읽음1385
    read more
  2. 아 진짜 요새 SKT 해킹 뭐시기 때문에 신경 쓰여 죽겠어 ㅠㅠ

    날짜2025.05.20 카테고리일반 읽음237
    read more
  3. 사랑LOVE 포인트 만렙! 도전

    날짜2025.03.19 카테고리 읽음4669
    read more
  4. 🚨(뉴비필독) 전체공지 & 포인트안내

    날짜2024.11.04 카테고리 읽음25850
    read more
  5. URL만 붙여넣으면 끝! 임베드 기능

    날짜2025.01.21 카테고리 읽음20432
    read more
  6. Intel 12세대 i3-12100YouTube 10비트 HDR 8K60 AV1 비디오를 원활하게 재생가능?

    날짜2024.11.10 조회수4540
    Read More
  7. 블루투스 헤드셋 질문좀~

    날짜2021.01.31 조회수49
    Read More
  8. e4000이랑 560s랑 음질차이

    날짜2021.01.28 조회수70
    Read More
  9. 未检测到我的手机MTP。

    날짜2019.12.24 조회수29
    Read More
  10. amd 라이젠 1700 > 인텔 i5 12400f cpu 변경후 드라이브 오류

    날짜2022.06.14 조회수1122
    Read More
  11. 윈도우 11 에러 중에 이런 종류가 있나요?

    날짜2022.06.14 조회수1085
    Read More
  12. 마소계정에 정품인증

    날짜2022.06.14 조회수420
    Read More
  13. 4k나 1080p 동영상 보면 렉이 걸리는데...

    날짜2022.06.14 조회수482
    Read More
  14. 제가쓰던 놋북 윈도우가 리테일이래요 그러니까 fpp 윈도우라는거 맞죠??

    날짜2022.06.14 조회수401
    Read More
  15. 윈도우 10 왜 버벅일까요..?

    날짜2022.06.14 조회수348
    Read More
  16. 오피스 정품 판매 맞을까요?

    날짜2022.06.14 조회수169
    Read More
  17. 윈도우11 더 많은 옵션 항상사용하는 방법

    날짜2022.06.09 조회수262
    Read More
  18. 윈도우 11 22H2 RTM 빌드 확정됨

    날짜2022.05.30 조회수223
    Read More
  19. 해킹 대회에서 윈도우 11의 취약점 6개가 발견됨

    날짜2022.05.30 조회수235
    Read More
  20. ProtonMail, 통합 브랜드로 다양한 서비스를 제공

    날짜2022.05.30 조회수185
    Read More
  21. 가상머신에 윈도우95 설치하기

    날짜2022.04.22 조회수630
    Read More
  22. 구글 크롬 100 버전 공개

    날짜2022.04.04 조회수839
    Read More
  23. 윈도우 11+다이렉트스토리지, 게임 로딩 시 CPU 부하가 최대 40% 감소

    날짜2022.04.04 조회수708
    Read More
  24. 애플, 위조된 법적 증명에 속아 사용자 데이터를 제공?

    날짜2022.04.04 조회수639
    Read More
  25. 윈도우 탐색기 대체 대안 프로그램 8가지

    날짜2022.04.04 조회수904
    Read More
  26. 인터넷은 어떻게 작동되는지 알아보자

    날짜2022.04.02 조회수675
    Read More
  27. 크롬 취약점 발견 Chrome 업데이트 빨리 해야

    날짜2022.03.30 조회수764
    Read More
  28. GPU-Z, 인텔 아크 알케미스트 그래픽 지원

    날짜2022.03.26 조회수147
    Read More
  29. 아프리카 TV가 트위치보다 데이터를 훨씬 많이 쓰는군요

    날짜2022.03.26 조회수224
    Read More
  30. 애플, 미국 애리조나 주에서 월렛에 신분증 기능 제공

    날짜2022.03.26 조회수151
    Read More
  31. macOS 12.3에서 외장 모니터 연결 문제, 게임 패드 연결 문제

    날짜2022.03.26 조회수164
    Read More
  32. 비트코인 오브 아메리카, ATM에서 도지코인을 취급

    날짜2022.03.26 조회수152
    Read More
  33. 1990년대 중후반에 나온 PowerVR PC GPU의 소스 코드 공개

    날짜2022.03.26 조회수158
    Read More
  34. NVIDIA, 삼성, MS를 해킹한 Lapsus$. 알고보니 10대 소년이 주범?

    날짜2022.03.26 조회수159
    Read More
  35. 통신사 직원 수십억원 갖고 잠적

    날짜2022.03.26 조회수364
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 355 Next
/ 355