SlideShare una empresa de Scribd logo
1 de 20
1Copyright 2011 Severalnines AB Control your database infrastructure
9th Installment
MySQL Cluster Self-Training
Part 8 – Designing a MySQL Cluster
2Copyright 2011 Severalnines AB Control your database infrastructure
Topics
• Node Placement
• Capacity Planning and Dimensioning
• Hardware recommendations
• Best practice configuration
• Storage calculations
3Copyright 2011 Severalnines AB Control your database infrastructure
Node Placement
• Data nodes should use dedicated instances
– Heavy user of RAM, CPU, and DISK
• API nodes (e.g. SQL node) should preferably be on
dedicated instance
– Heavy user of CPU, but little DISK
– RAM usage dependant on workload
• Management servers
– Negligible use of CPU, DISK, RAM
4Copyright 2011 Severalnines AB Control your database infrastructure
Co-location
• Do not co-locate API nodes with Data nodes
– They will compete for CPU
– RAM usage for API nodes may grow, competing with
resources of the Data node (causing swapping and node
failures)
• Don’t co-locate Management servers with Data
nodes
– You lose protection from split brain/network partitioning
• API nodes and Management servers can be co-
located
5Copyright 2011 Severalnines AB Control your database infrastructure
Cluster Size
• Number of Data Nodes
– Depends on Storage and Throughput requirements
– Use Sizer (http://www.severalnines.com/sizer) to calculate
storage requirements for your data
– At least two for redundancy
• Number of API Nodes
– Depends on the expected level of Throughput
– At least two for redundancy
– Usually recommended to have 2x API nodes compared to Data
nodes (2 data nodes  4 API nodes). Especially for API nodes
using the synchronous NDB API (mysqld, Cluster/J)
• Number of Management servers
– Two for redundancy. Always!
– Having one management server on every API node does not
make sense
6Copyright 2011 Severalnines AB Control your database infrastructure
Good Initial Setup (1)
STORAGE LAYER (NDBCLUSTER)
ACCESS LAYER
API node
ndb_mgmd
API node
ndb_mgmd
ndbmtd ndbmtd
CLUSTER CONTROL
mysqld
cmon
7Copyright 2011 Severalnines AB Control your database infrastructure
Good Initial Setup (2)
• Easy to scale:
– Data nodes can be added online (it is not easy but possible)
– API nodes can be added online (as long as there are free
[mysqld] slots in config.ini)
• Can be extended
– Replicating out to an InnoDB database for
reportinghttp://johanandersson.blogspot.se/2012/09/mysql-
cluster-to-innodb-replication.html
– Using the Hadoop Applier (oracle)
https://blogs.oracle.com/MySQL/entry/announcing_the_mys
ql_hadoop_applier
• The suggested setup is only a starting point
– The questions on the next slides might help determine if you
need more nodes
8Copyright 2011 Severalnines AB Control your database infrastructure
Good Initial Setup (3)
• Can you load in the data that you need?
– YES: good
– NO:
• Can you add more RAM to the data nodes?
If not, create a new cluster with four nodes. Try and load in the
data gain.
• Can some of the less active tables use DISK DATA storage?
Avoid DISK DATA tables for frequently used data
• Use Severalnines Sizer (http://www.severalnines.com/sizer/)
(capacity planning tool). Create the schema in NDB Cluster,
run sizer and import the result to a spreadsheet. Manipulate the
row count.
• Use sizer to verify growth scenarios
9Copyright 2011 Severalnines AB Control your database infrastructure
Good Initial Setup (4)
• Can you handle the throughput you need?
– verify with Bencher (www.severalnines.com/bencher/)
– YES: good
– NO:
• Are the data nodes the bottleneck?
Run:
top –Hd1
Any of the data nodes threads running >90%?
YES: create a new cluster with 2x the number of nodes.
NO: The APIs can be the bottleneck. Add more API nodes
• Tune schema and queries/requests (possible play with the NDB
cluster connection pool as well)
10Copyright 2011 Severalnines AB Control your database infrastructure
Hardware for Data Nodes
• 8 cores or more
– Fast CPU and memory bus is important
• As much RAM as you need
– Memory tables and indexes for DISK DATA tables must fit in RAM
• Disk Subsystem:
– SATA2 is the absolute minimum (7200RPM), but not really suitable for
production
– Better options are:
• SAS
• SSD
• AWS IOPS preferably
– RAID 1+0 – requires 4 disks
• Disk Storage Capacity
– 10xDataMemory (for REDO LOG and LCP)
• If you use Disk data tables
– One disk for LCP
– One disk for Tablespace (SSD could be an option)
– One disk for UNDO/ REDO
11Copyright 2011 Severalnines AB Control your database infrastructure
Hardware for API Nodes
• 8 cores or more
– Fast CPU and memory bus is important
• Disks
– Replication servers:
• Disk space must be dimensioned to store binary logs/relay logs
• 5MB/s written into NDB  binary logs will grow with 5MB/s
– Disk is not important for the API Nodes
• API nodes do not save any state information to disk (except
small meta data like .frm files)
12Copyright 2011 Severalnines AB Control your database infrastructure
Network
• Network interconnect is important
– Ethernet
• 1Gig-E is most common
• 10Gig-E is coming
– Infiniband
• IBOIP
• Lower latency than Ethernet
• Load-balancing
– Hardware: F5, Extreme Summit, Cisco
– Software: HAProxy, LVS
13Copyright 2011 Severalnines AB Control your database infrastructure
Storage Calculations
• Two things to consider
– Disk space
– Memory consumption
14Copyright 2011 Severalnines AB Control your database infrastructure
Disk Space
• One data node needs
– 3xDM for LCP (3x for Headroom, 2x is on the limit)
– 4-6xDM for Redo Log
• 4x – read mostly applications
• 6x – write intensive applications
– Tablespace
• Depends on how much data you plan to store on disk
• Storage needed per table per node:
2 x( #records x size_of_non_indexed_cols + 40B) x NoOfReplicas /#nodes
Note: 40B is the record overhead
– Store one or more backups
• 1 x DM for each backup
• This sums to >8x disk space than DataMemory
15Copyright 2011 Severalnines AB Control your database infrastructure
DataMemory and IndexMemory
• IndexMemory = 20B xsum_for_all_records
• DataMemory / per table = 40B + avg_record_size
• Per node:
– DataMemory=SUM(DataMemory/table) x NO_OF_NODES /
NO_OF_REPLICAS
– IndexMemory=IndexMemoryx NO_OF_NODES /
NO_OF_REPLICAS
• Easy way:
– www.severalnines.com/sizer
• Provision a data model in cluster
Run: ./sizer –a
Import the csv data into the excel template.
16Copyright 2011 Severalnines AB Control your database infrastructure
Disk Data tables
• Not everything has to stay in RAM.
– Log data, archives etc not frequently accessed can be stored
in DISK DATA tables:
http://johanandersson.blogspot.se/2012/04/mysql-cluster-
disk-data-config.html
– Indexedcolumnswillalwaysstay in RAM for DISK DATA
tables.
– Disk data access is notfast, butSSDshelps a lot.
– Disk Data tablespacecanbeincreasedovertimeonline.
17Copyright 2011 Severalnines AB Control your database infrastructure
Performance Planning
• Transaction capacity planning requires benchmarking
– Throughput and Response times requirements affects the
number of nodes, both data nodes and mysql servers.
• Benchmark the common use cases
– Severalnines Bencher allows to drive a high load and test
individual queries.
– Jmeteretc can be used to drive web load
– Try to simulate expected peak traffic.
• Can the cluster handle the load? If not add resources
online where needed.
18Copyright 2011 Severalnines AB Control your database infrastructure
Coming next in Installment 10:
Troubleshooting MySQL Cluster
19Copyright 2011 Severalnines AB Control your database infrastructure
We hope these training slides are
useful to you!
Please visit our website to view the
next section of this training.
For any questions, comments or feedback,
please contact us at:
services@severalnines.com
Thank you!
20Copyright 2011 Severalnines AB Control your database infrastructure
Disclaimer
© Copyright 2011 Severalnines AB. All rights reserved.
Severalnines& the Severalnineslogo(s) are trademarks of Severalnines AB.
MySQL is a registered trademark of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.

Más contenido relacionado

La actualidad más candente

MySQL Performance Tuning
MySQL Performance TuningMySQL Performance Tuning
MySQL Performance Tuning
FromDual GmbH
 
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdfDatabase & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
InSync2011
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Jignesh Shah
 

La actualidad más candente (20)

Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
 
Ibm spectrum scale_backup_n_archive_v03_ash
Ibm spectrum scale_backup_n_archive_v03_ashIbm spectrum scale_backup_n_archive_v03_ash
Ibm spectrum scale_backup_n_archive_v03_ash
 
Conference tutorial: MySQL Cluster as NoSQL
Conference tutorial: MySQL Cluster as NoSQLConference tutorial: MySQL Cluster as NoSQL
Conference tutorial: MySQL Cluster as NoSQL
 
MySQL Performance Tuning
MySQL Performance TuningMySQL Performance Tuning
MySQL Performance Tuning
 
MySQL :What's New #GIDS16
MySQL :What's New #GIDS16MySQL :What's New #GIDS16
MySQL :What's New #GIDS16
 
My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015My sql5.7 whatsnew_presentedatgids2015
My sql5.7 whatsnew_presentedatgids2015
 
Webinar Sept 22: Gluster Partners with Redapt to Deliver Scale-Out NAS Storage
Webinar Sept 22: Gluster Partners with Redapt to Deliver Scale-Out NAS StorageWebinar Sept 22: Gluster Partners with Redapt to Deliver Scale-Out NAS Storage
Webinar Sept 22: Gluster Partners with Redapt to Deliver Scale-Out NAS Storage
 
IBM Platform Computing Elastic Storage
IBM Platform Computing  Elastic StorageIBM Platform Computing  Elastic Storage
IBM Platform Computing Elastic Storage
 
Intro to GlusterFS Webinar - August 2011
Intro to GlusterFS Webinar - August 2011Intro to GlusterFS Webinar - August 2011
Intro to GlusterFS Webinar - August 2011
 
Ibm spectrum scale fundamentals workshop for americas part 3 Information Life...
Ibm spectrum scale fundamentals workshop for americas part 3 Information Life...Ibm spectrum scale fundamentals workshop for americas part 3 Information Life...
Ibm spectrum scale fundamentals workshop for americas part 3 Information Life...
 
Spectrum Scale - Diversified analytic solution based on various storage servi...
Spectrum Scale - Diversified analytic solution based on various storage servi...Spectrum Scale - Diversified analytic solution based on various storage servi...
Spectrum Scale - Diversified analytic solution based on various storage servi...
 
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdfDatabase & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
 
Ibm spectrum scale fundamentals workshop for americas part 1 components archi...
Ibm spectrum scale fundamentals workshop for americas part 1 components archi...Ibm spectrum scale fundamentals workshop for americas part 1 components archi...
Ibm spectrum scale fundamentals workshop for americas part 1 components archi...
 
Introduction to GlusterFS Webinar - September 2011
Introduction to GlusterFS Webinar - September 2011Introduction to GlusterFS Webinar - September 2011
Introduction to GlusterFS Webinar - September 2011
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
 
IBM Spectrum Scale Overview november 2015
IBM Spectrum Scale Overview november 2015IBM Spectrum Scale Overview november 2015
IBM Spectrum Scale Overview november 2015
 
Enterprise PostgreSQL - EDB's answer to conventional Databases
Enterprise PostgreSQL - EDB's answer to conventional DatabasesEnterprise PostgreSQL - EDB's answer to conventional Databases
Enterprise PostgreSQL - EDB's answer to conventional Databases
 
Best Practices for Virtualizing Hadoop
Best Practices for Virtualizing HadoopBest Practices for Virtualizing Hadoop
Best Practices for Virtualizing Hadoop
 
IBM Spectrum Scale for File and Object Storage
IBM Spectrum Scale for File and Object StorageIBM Spectrum Scale for File and Object Storage
IBM Spectrum Scale for File and Object Storage
 
Ibm spectrum scale fundamentals workshop for americas part 4 Replication, Str...
Ibm spectrum scale fundamentals workshop for americas part 4 Replication, Str...Ibm spectrum scale fundamentals workshop for americas part 4 Replication, Str...
Ibm spectrum scale fundamentals workshop for americas part 4 Replication, Str...
 

Similar a Severalnines Training: MySQL® Cluster - Part IX

001 hbase introduction
001 hbase introduction001 hbase introduction
001 hbase introduction
Scott Miao
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
Liran Zelkha
 
Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]
shuwutong
 
In-Memory Data Grids - Ampool (1)
In-Memory Data Grids - Ampool (1)In-Memory Data Grids - Ampool (1)
In-Memory Data Grids - Ampool (1)
Chinmay Kulkarni
 

Similar a Severalnines Training: MySQL® Cluster - Part IX (20)

001 hbase introduction
001 hbase introduction001 hbase introduction
001 hbase introduction
 
Database as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance PlatformDatabase as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance Platform
 
Oracle real application_cluster
Oracle real application_clusterOracle real application_cluster
Oracle real application_cluster
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
 
Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]Kb 40 kevin_klineukug_reading20070717[1]
Kb 40 kevin_klineukug_reading20070717[1]
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph
 
RedisConf17 - Redis Enterprise on IBM Power Systems
RedisConf17 - Redis Enterprise on IBM Power SystemsRedisConf17 - Redis Enterprise on IBM Power Systems
RedisConf17 - Redis Enterprise on IBM Power Systems
 
Ceph Day London 2014 - Best Practices for Ceph-powered Implementations of Sto...
Ceph Day London 2014 - Best Practices for Ceph-powered Implementations of Sto...Ceph Day London 2014 - Best Practices for Ceph-powered Implementations of Sto...
Ceph Day London 2014 - Best Practices for Ceph-powered Implementations of Sto...
 
In-Memory Data Grids - Ampool (1)
In-Memory Data Grids - Ampool (1)In-Memory Data Grids - Ampool (1)
In-Memory Data Grids - Ampool (1)
 
Revolutionary Storage for Modern Databases, Applications and Infrastrcture
Revolutionary Storage for Modern Databases, Applications and InfrastrctureRevolutionary Storage for Modern Databases, Applications and Infrastrcture
Revolutionary Storage for Modern Databases, Applications and Infrastrcture
 
Running Oracle EBS in the cloud (DOAG TECH17 edition)
Running Oracle EBS in the cloud (DOAG TECH17 edition)Running Oracle EBS in the cloud (DOAG TECH17 edition)
Running Oracle EBS in the cloud (DOAG TECH17 edition)
 
North Bay Ruby Meetup 101911
North Bay Ruby Meetup 101911North Bay Ruby Meetup 101911
North Bay Ruby Meetup 101911
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
 
Hardware Provisioning
Hardware ProvisioningHardware Provisioning
Hardware Provisioning
 
Ceph
CephCeph
Ceph
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
LCA13: Jason Taylor Keynote - ARM & Disaggregated Rack - LCA13-Hong - 6 March...
LCA13: Jason Taylor Keynote - ARM & Disaggregated Rack - LCA13-Hong - 6 March...LCA13: Jason Taylor Keynote - ARM & Disaggregated Rack - LCA13-Hong - 6 March...
LCA13: Jason Taylor Keynote - ARM & Disaggregated Rack - LCA13-Hong - 6 March...
 
Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18
 
Building a High Performance Analytics Platform
Building a High Performance Analytics PlatformBuilding a High Performance Analytics Platform
Building a High Performance Analytics Platform
 
Redis meetup
Redis meetupRedis meetup
Redis meetup
 

Más de Severalnines

Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
Severalnines
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Severalnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Severalnines
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Severalnines
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Severalnines
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Severalnines
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Severalnines
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
Severalnines
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High Availability
Severalnines
 
Webinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database ManagementWebinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database Management
Severalnines
 

Más de Severalnines (20)

Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The Basics
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High Availability
 
Webinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database ManagementWebinar slides: How to Get Started with Open Source Database Management
Webinar slides: How to Get Started with Open Source Database Management
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Severalnines Training: MySQL® Cluster - Part IX

  • 1. 1Copyright 2011 Severalnines AB Control your database infrastructure 9th Installment MySQL Cluster Self-Training Part 8 – Designing a MySQL Cluster
  • 2. 2Copyright 2011 Severalnines AB Control your database infrastructure Topics • Node Placement • Capacity Planning and Dimensioning • Hardware recommendations • Best practice configuration • Storage calculations
  • 3. 3Copyright 2011 Severalnines AB Control your database infrastructure Node Placement • Data nodes should use dedicated instances – Heavy user of RAM, CPU, and DISK • API nodes (e.g. SQL node) should preferably be on dedicated instance – Heavy user of CPU, but little DISK – RAM usage dependant on workload • Management servers – Negligible use of CPU, DISK, RAM
  • 4. 4Copyright 2011 Severalnines AB Control your database infrastructure Co-location • Do not co-locate API nodes with Data nodes – They will compete for CPU – RAM usage for API nodes may grow, competing with resources of the Data node (causing swapping and node failures) • Don’t co-locate Management servers with Data nodes – You lose protection from split brain/network partitioning • API nodes and Management servers can be co- located
  • 5. 5Copyright 2011 Severalnines AB Control your database infrastructure Cluster Size • Number of Data Nodes – Depends on Storage and Throughput requirements – Use Sizer (http://www.severalnines.com/sizer) to calculate storage requirements for your data – At least two for redundancy • Number of API Nodes – Depends on the expected level of Throughput – At least two for redundancy – Usually recommended to have 2x API nodes compared to Data nodes (2 data nodes  4 API nodes). Especially for API nodes using the synchronous NDB API (mysqld, Cluster/J) • Number of Management servers – Two for redundancy. Always! – Having one management server on every API node does not make sense
  • 6. 6Copyright 2011 Severalnines AB Control your database infrastructure Good Initial Setup (1) STORAGE LAYER (NDBCLUSTER) ACCESS LAYER API node ndb_mgmd API node ndb_mgmd ndbmtd ndbmtd CLUSTER CONTROL mysqld cmon
  • 7. 7Copyright 2011 Severalnines AB Control your database infrastructure Good Initial Setup (2) • Easy to scale: – Data nodes can be added online (it is not easy but possible) – API nodes can be added online (as long as there are free [mysqld] slots in config.ini) • Can be extended – Replicating out to an InnoDB database for reportinghttp://johanandersson.blogspot.se/2012/09/mysql- cluster-to-innodb-replication.html – Using the Hadoop Applier (oracle) https://blogs.oracle.com/MySQL/entry/announcing_the_mys ql_hadoop_applier • The suggested setup is only a starting point – The questions on the next slides might help determine if you need more nodes
  • 8. 8Copyright 2011 Severalnines AB Control your database infrastructure Good Initial Setup (3) • Can you load in the data that you need? – YES: good – NO: • Can you add more RAM to the data nodes? If not, create a new cluster with four nodes. Try and load in the data gain. • Can some of the less active tables use DISK DATA storage? Avoid DISK DATA tables for frequently used data • Use Severalnines Sizer (http://www.severalnines.com/sizer/) (capacity planning tool). Create the schema in NDB Cluster, run sizer and import the result to a spreadsheet. Manipulate the row count. • Use sizer to verify growth scenarios
  • 9. 9Copyright 2011 Severalnines AB Control your database infrastructure Good Initial Setup (4) • Can you handle the throughput you need? – verify with Bencher (www.severalnines.com/bencher/) – YES: good – NO: • Are the data nodes the bottleneck? Run: top –Hd1 Any of the data nodes threads running >90%? YES: create a new cluster with 2x the number of nodes. NO: The APIs can be the bottleneck. Add more API nodes • Tune schema and queries/requests (possible play with the NDB cluster connection pool as well)
  • 10. 10Copyright 2011 Severalnines AB Control your database infrastructure Hardware for Data Nodes • 8 cores or more – Fast CPU and memory bus is important • As much RAM as you need – Memory tables and indexes for DISK DATA tables must fit in RAM • Disk Subsystem: – SATA2 is the absolute minimum (7200RPM), but not really suitable for production – Better options are: • SAS • SSD • AWS IOPS preferably – RAID 1+0 – requires 4 disks • Disk Storage Capacity – 10xDataMemory (for REDO LOG and LCP) • If you use Disk data tables – One disk for LCP – One disk for Tablespace (SSD could be an option) – One disk for UNDO/ REDO
  • 11. 11Copyright 2011 Severalnines AB Control your database infrastructure Hardware for API Nodes • 8 cores or more – Fast CPU and memory bus is important • Disks – Replication servers: • Disk space must be dimensioned to store binary logs/relay logs • 5MB/s written into NDB  binary logs will grow with 5MB/s – Disk is not important for the API Nodes • API nodes do not save any state information to disk (except small meta data like .frm files)
  • 12. 12Copyright 2011 Severalnines AB Control your database infrastructure Network • Network interconnect is important – Ethernet • 1Gig-E is most common • 10Gig-E is coming – Infiniband • IBOIP • Lower latency than Ethernet • Load-balancing – Hardware: F5, Extreme Summit, Cisco – Software: HAProxy, LVS
  • 13. 13Copyright 2011 Severalnines AB Control your database infrastructure Storage Calculations • Two things to consider – Disk space – Memory consumption
  • 14. 14Copyright 2011 Severalnines AB Control your database infrastructure Disk Space • One data node needs – 3xDM for LCP (3x for Headroom, 2x is on the limit) – 4-6xDM for Redo Log • 4x – read mostly applications • 6x – write intensive applications – Tablespace • Depends on how much data you plan to store on disk • Storage needed per table per node: 2 x( #records x size_of_non_indexed_cols + 40B) x NoOfReplicas /#nodes Note: 40B is the record overhead – Store one or more backups • 1 x DM for each backup • This sums to >8x disk space than DataMemory
  • 15. 15Copyright 2011 Severalnines AB Control your database infrastructure DataMemory and IndexMemory • IndexMemory = 20B xsum_for_all_records • DataMemory / per table = 40B + avg_record_size • Per node: – DataMemory=SUM(DataMemory/table) x NO_OF_NODES / NO_OF_REPLICAS – IndexMemory=IndexMemoryx NO_OF_NODES / NO_OF_REPLICAS • Easy way: – www.severalnines.com/sizer • Provision a data model in cluster Run: ./sizer –a Import the csv data into the excel template.
  • 16. 16Copyright 2011 Severalnines AB Control your database infrastructure Disk Data tables • Not everything has to stay in RAM. – Log data, archives etc not frequently accessed can be stored in DISK DATA tables: http://johanandersson.blogspot.se/2012/04/mysql-cluster- disk-data-config.html – Indexedcolumnswillalwaysstay in RAM for DISK DATA tables. – Disk data access is notfast, butSSDshelps a lot. – Disk Data tablespacecanbeincreasedovertimeonline.
  • 17. 17Copyright 2011 Severalnines AB Control your database infrastructure Performance Planning • Transaction capacity planning requires benchmarking – Throughput and Response times requirements affects the number of nodes, both data nodes and mysql servers. • Benchmark the common use cases – Severalnines Bencher allows to drive a high load and test individual queries. – Jmeteretc can be used to drive web load – Try to simulate expected peak traffic. • Can the cluster handle the load? If not add resources online where needed.
  • 18. 18Copyright 2011 Severalnines AB Control your database infrastructure Coming next in Installment 10: Troubleshooting MySQL Cluster
  • 19. 19Copyright 2011 Severalnines AB Control your database infrastructure We hope these training slides are useful to you! Please visit our website to view the next section of this training. For any questions, comments or feedback, please contact us at: services@severalnines.com Thank you!
  • 20. 20Copyright 2011 Severalnines AB Control your database infrastructure Disclaimer © Copyright 2011 Severalnines AB. All rights reserved. Severalnines& the Severalnineslogo(s) are trademarks of Severalnines AB. MySQL is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.