SlideShare a Scribd company logo
Mysql8 advance tuning
with Resource Group
Marco Tusa
Percona
2
About me
Marco “The Grinch”
• Former UN, MySQL AB, Pythian, Percona
• 2 kids, 1 wife
• History of Religions;
Ski; Snowboard; Scuba Diving;
3
My Motto
Use the Right Tool for the Job
4
Summary
1. Resource Group overview
1. RG Attributes
2. RG Management
3. RG limitations/warning
2. Real case to solve
3. The recipe
1. Implement it
4. Tests … and more tests
5. Conclusions
5
Distribute load
• Multicore CPUs
• OS supporting multicore
• Application written for
parallelism (multi threading)
• MySQL Thread-Connection
• ProxyMySQL (multiplexing)
OR connection pooling
6
Resource Group Attributes
(root@localhost) [information_schema]>describe resource_groups;
+------------------------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------------+-----------------------+------+-----+---------+-------+
| RESOURCE_GROUP_NAME | varchar(64) | NO | | NULL | |
| RESOURCE_GROUP_TYPE | enum('SYSTEM','USER') | NO | | NULL | |
| RESOURCE_GROUP_ENABLED | tinyint(1) | NO | | NULL | |
| VCPU_IDS | blob | YES | | NULL | |
| THREAD_PRIORITY | int(11) | NO | | NULL | |
+------------------------+-----------------------+------+-----+---------+-------+
7
Resource Group Management
• GRANT RESOURCE_GROUP_ADMIN,RESOURCE_GROUP_USER
• STATUS
• Com_alter_resource_group
• Com_create_resource_group
• Com_drop_resource_group
drop RESOURCE GROUP Select_app2;
CREATE RESOURCE GROUP Select_app2 TYPE=USER VCPU=5
THREAD_PRIORITY=19;
ALTER RESOURCE GROUP Select_app2 VCPU = 1 THREAD_PRIORITY = 19
8
Resource Group Management
For system resource groups, the permitted priority range is -20 to 0.
For user resource groups, the permitted priority range is 0 to 19.
Priority Range Windows Priority Level
-20 to -10 THREAD_PRIORITY_HIGHEST
-9 to -1 THREAD_PRIORITY_ABOVE_NORMAL
0 THREAD_PRIORITY_NORMAL
1 to 10 THREAD_PRIORITY_BELOW_NORMAL
11 to 19 THREAD_PRIORITY_LOWEST
9
Resource Group Management
To assign a thread to the Batch group:
SET RESOURCE GROUP Select_app2 FOR thread_id;
If a session's own current thread should be in the Batch group, execute this
statement within the session:
SET RESOURCE GROUP Select_app2;
To execute a single statement using the Batch group,
use the RESOURCE_GROUP optimizer hint:
INSERT /*+ RESOURCE_GROUP(Select_app2) */
INTO t2 VALUES(2);
10
Resource Group Warning
• Resource group management is local to the server on which it occurs.
No replication
• Resource groups are unavailable if the thread pool plugin is installed
• On FreeBSD and Solaris, resource group thread priorities are ignored.
• Linux CAP_SYS_NICE capability must be set.
• sudo setcap cap_sys_nice+ep <Path to you mysqld executable>
getcap ./bin/mysqld
./bin/mysqld = cap_sys_nice+ep
11
The case
I have a very noisy secondary application written by a very, very bad
developer that accesses my servers, mostly with read queries, and
occasionally with write updates. Reads and writes are obsessive and create
an impact on the MAIN application. My task is to limit the impact of this
secondary application without having the main one affected. To do that
I will create two resource groups, one for WRITE and another for READ. The
first group, Write_app2, will have no cpu affiliation, but will have lowest
priority.
12
The recipe
• Two users
• App1 (good guy)
• App2 (nasty bad developer)
• Master – Slave pair
• 2 Set of Resource group settings (Master/Slave)
• ProxySQL
• 2 Host groups
• Query rules fro read/write split
• Query rules fro Query rewrite
13
How to implement it
• MySQL
• CREATE RESOURCE GROUP Write_app2 TYPE=USER THREAD_PRIORITY=19;
• CREATE RESOURCE GROUP Select_app2 TYPE=USER VCPU=5 THREAD_PRIORITY=19;
• ProxySQL
• insert into mysql_users … values ('app2','test',1,80,'mysql',1);
insert into mysql_users … values ('app1','test',1,80,'mysql',1);
• insert into mysql_query_rules …values(80,6033,'app1',80,1,3,'^SELECT.*FOR UPDATE',1,1);
insert into mysql_query_rules… values(81,6033,'app1',81,1,3,'^SELECT.*',1,1);
insert into mysql_query_rules ... values(82,6033,'app2',80,1,3,'^SELECT.*FOR UPDATE',1,1);
insert into mysql_query_rules ... values(83,6033,'app2',81,1,3,'^SELECT.*',1,1);
• INSERT INTO mysql_query_rules … VALUES (32,1,'app2',"(^SELECT)s*(.*$)","1 /*+
RESOURCE_GROUP(Select_app2) */ 2 ",0,"Lower prio and CPU bound on Reader");
• INSERT INTO mysql_query_rules … VALUES (33,1,'app2',"^(INSERT|UPDATE|DELETE)s*(.*$)","1
/*+ RESOURCE_GROUP(Write_app2) */ 2 ",0,"Lower prio on Writer");
14
Testing the whole thing
• test1 run both apps with read/write and rule disabled for RG
• test2 run only App2 without & with RG to see the cost on the
execution
• test3 run both to see what happen with RG
15
Results Test1 - CPU
Master
Slave
16
Results Test1 - CRUD
App 1 App 2
9
15464
4241
1333
165 308
0
2000
4000
6000
8000
10000
12000
14000
16000
18000
1
#EVENTS
EVENT BY APPLICATION AND TYPE OF CRUD
# Events by CRUD and Application
#Insert events App1 #Update events App1 #Update events App2 #Delete events App1 #Select events App1 #Select events App2
17
Results Test1 - time
69016
5372 4564
29626
10780 10835
0
10000
20000
30000
40000
50000
60000
70000
80000
1
EXECUTIONAVERAGEINMS
EXECUTION PER CRUD OPERATION APP1 AND APP2
Execution time
Insert Exec time App1 Update Exec time App1 Update Exec time App2 Delete Exec time App1 Select Exec time App1 Select Exec time App2
18
Results Test2 - CPU
Master only nasty APP no LIMIT
Master only nasty APP WITH LIMIT
19
Results Test2 - CPU
Slave only nasty APP no LIMIT
Slave only nasty APP WITH LIMIT
20
Results Test2 - CRUD
Test without limit Test with limit
21
Results Test2 - time
Test without limit Test with limit
22
Results Test3 - CPU
Master
Slave
25
Compare Before VS After - CRUD
Test without limit Test with limit
26
Compare Before VS After - time
Test without limit Test with limit
27
Conclusions
• Mission accomplished
• Resource group is a simple but not easy to use feature
• Must be used in conjunction with something like ProxySQL or if you want
to use on the thread a smart scripting
• Doesn’t work well with Connection Pooling
• You will not get it right at the first attempt so:
• Work on test environment first
• Test Test Test
• Keep production under observation for a long while to be sure you are not creating a
mess
• Use it as Last Man Standing option
28
Q&A
Ad

More Related Content

What's hot (20)

What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
Mydbops
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Kenny Gryp
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
Codership Oy - Creators of Galera Cluster
 
Proxysql sharding
Proxysql shardingProxysql sharding
Proxysql sharding
Marco Tusa
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Sveta Smirnova
 
Galera explained 3
Galera explained 3Galera explained 3
Galera explained 3
Marco Tusa
 
Do more with Galera Cluster in your OpenStack cloud
Do more with Galera Cluster in your OpenStack cloudDo more with Galera Cluster in your OpenStack cloud
Do more with Galera Cluster in your OpenStack cloud
philip_stoev
 
合并到 XtraDB 存储引擎集群
合并到 XtraDB 存储引擎集群合并到 XtraDB 存储引擎集群
合并到 XtraDB 存储引擎集群
YUCHENG HU
 
Proxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteProxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynote
Marco Tusa
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
I Goo Lee
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
Mydbops
 
Galera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slidesGalera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slides
Severalnines
 
ProxySQL para mysql
ProxySQL para mysqlProxySQL para mysql
ProxySQL para mysql
Marcelo Altmann
 
Using Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data AnalysisUsing Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data Analysis
Sveta Smirnova
 
Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera Cluster
Severalnines
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
Derek Downey
 
Introduction to MariaDB MaxScale
Introduction to MariaDB MaxScaleIntroduction to MariaDB MaxScale
Introduction to MariaDB MaxScale
I Goo Lee
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten Clustering
Continuent
 
Zero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best PracticesZero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best Practices
Severalnines
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Severalnines
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
Mydbops
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Kenny Gryp
 
Proxysql sharding
Proxysql shardingProxysql sharding
Proxysql sharding
Marco Tusa
 
MySQL Performance Schema in 20 Minutes
 MySQL Performance Schema in 20 Minutes MySQL Performance Schema in 20 Minutes
MySQL Performance Schema in 20 Minutes
Sveta Smirnova
 
Galera explained 3
Galera explained 3Galera explained 3
Galera explained 3
Marco Tusa
 
Do more with Galera Cluster in your OpenStack cloud
Do more with Galera Cluster in your OpenStack cloudDo more with Galera Cluster in your OpenStack cloud
Do more with Galera Cluster in your OpenStack cloud
philip_stoev
 
合并到 XtraDB 存储引擎集群
合并到 XtraDB 存储引擎集群合并到 XtraDB 存储引擎集群
合并到 XtraDB 存储引擎集群
YUCHENG HU
 
Proxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteProxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynote
Marco Tusa
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
I Goo Lee
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
Mydbops
 
Galera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slidesGalera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slides
Severalnines
 
Using Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data AnalysisUsing Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data Analysis
Sveta Smirnova
 
Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera Cluster
Severalnines
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
Derek Downey
 
Introduction to MariaDB MaxScale
Introduction to MariaDB MaxScaleIntroduction to MariaDB MaxScale
Introduction to MariaDB MaxScale
I Goo Lee
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten Clustering
Continuent
 
Zero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best PracticesZero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best Practices
Severalnines
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Severalnines
 

Similar to Mysql8 advance tuning with resource group (20)

Velocity 2018 preetha appan final
Velocity 2018   preetha appan finalVelocity 2018   preetha appan final
Velocity 2018 preetha appan final
preethaappan
 
Monitoring at/with SUSE 2015
Monitoring at/with SUSE 2015Monitoring at/with SUSE 2015
Monitoring at/with SUSE 2015
Lars Vogdt
 
How eBay does Automatic Outage Planning
How eBay does Automatic Outage PlanningHow eBay does Automatic Outage Planning
How eBay does Automatic Outage Planning
CA | Automic Software
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Daniel Coupal
 
Using Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comUsing Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.com
Damien Krotkine
 
Incrementalism: An Industrial Strategy For Adopting Modern Automation
Incrementalism: An Industrial Strategy For Adopting Modern AutomationIncrementalism: An Industrial Strategy For Adopting Modern Automation
Incrementalism: An Industrial Strategy For Adopting Modern Automation
Sean Chittenden
 
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Toronto-Oracle-Users-Group
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Kristofferson A
 
Managing Apache Spark Workload and Automatic Optimizing
Managing Apache Spark Workload and Automatic OptimizingManaging Apache Spark Workload and Automatic Optimizing
Managing Apache Spark Workload and Automatic Optimizing
Databricks
 
Oracle real application clusters system tests with demo
Oracle real application clusters system tests with demoOracle real application clusters system tests with demo
Oracle real application clusters system tests with demo
Ajith Narayanan
 
A Backup Today Saves Tomorrow
A Backup Today Saves TomorrowA Backup Today Saves Tomorrow
A Backup Today Saves Tomorrow
Andrew Moore
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at Yelp
Nathan Handler
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
Abdul Manaf
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
OSSCube
 
Practice and challenges from building IaaS
Practice and challenges from building IaaSPractice and challenges from building IaaS
Practice and challenges from building IaaS
Shawn Zhu
 
Network Automation with Salt and NAPALM: Introuction
Network Automation with Salt and NAPALM: IntrouctionNetwork Automation with Salt and NAPALM: Introuction
Network Automation with Salt and NAPALM: Introuction
Cloudflare
 
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
DataWorks Summit
 
ApacheCon BigData - What it takes to process a trillion events a day?
ApacheCon BigData - What it takes to process a trillion events a day?ApacheCon BigData - What it takes to process a trillion events a day?
ApacheCon BigData - What it takes to process a trillion events a day?
Jagadish Venkatraman
 
An introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methodsAn introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methods
Ajith Narayanan
 
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud
 
Velocity 2018 preetha appan final
Velocity 2018   preetha appan finalVelocity 2018   preetha appan final
Velocity 2018 preetha appan final
preethaappan
 
Monitoring at/with SUSE 2015
Monitoring at/with SUSE 2015Monitoring at/with SUSE 2015
Monitoring at/with SUSE 2015
Lars Vogdt
 
How eBay does Automatic Outage Planning
How eBay does Automatic Outage PlanningHow eBay does Automatic Outage Planning
How eBay does Automatic Outage Planning
CA | Automic Software
 
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The SequelSilicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Silicon Valley Code Camp 2015 - Advanced MongoDB - The Sequel
Daniel Coupal
 
Using Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.comUsing Riak for Events storage and analysis at Booking.com
Using Riak for Events storage and analysis at Booking.com
Damien Krotkine
 
Incrementalism: An Industrial Strategy For Adopting Modern Automation
Incrementalism: An Industrial Strategy For Adopting Modern AutomationIncrementalism: An Industrial Strategy For Adopting Modern Automation
Incrementalism: An Industrial Strategy For Adopting Modern Automation
Sean Chittenden
 
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Toronto-Oracle-Users-Group
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Kristofferson A
 
Managing Apache Spark Workload and Automatic Optimizing
Managing Apache Spark Workload and Automatic OptimizingManaging Apache Spark Workload and Automatic Optimizing
Managing Apache Spark Workload and Automatic Optimizing
Databricks
 
Oracle real application clusters system tests with demo
Oracle real application clusters system tests with demoOracle real application clusters system tests with demo
Oracle real application clusters system tests with demo
Ajith Narayanan
 
A Backup Today Saves Tomorrow
A Backup Today Saves TomorrowA Backup Today Saves Tomorrow
A Backup Today Saves Tomorrow
Andrew Moore
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at Yelp
Nathan Handler
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
Abdul Manaf
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
OSSCube
 
Practice and challenges from building IaaS
Practice and challenges from building IaaSPractice and challenges from building IaaS
Practice and challenges from building IaaS
Shawn Zhu
 
Network Automation with Salt and NAPALM: Introuction
Network Automation with Salt and NAPALM: IntrouctionNetwork Automation with Salt and NAPALM: Introuction
Network Automation with Salt and NAPALM: Introuction
Cloudflare
 
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
DataWorks Summit
 
ApacheCon BigData - What it takes to process a trillion events a day?
ApacheCon BigData - What it takes to process a trillion events a day?ApacheCon BigData - What it takes to process a trillion events a day?
ApacheCon BigData - What it takes to process a trillion events a day?
Jagadish Venkatraman
 
An introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methodsAn introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methods
Ajith Narayanan
 
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud Tech Talks S01E09 - OVHcloud Data Processing : Le nouveau service po...
OVHcloud
 
Ad

More from Marco Tusa (19)

Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Marco Tusa
 
My sql on kubernetes demystified
My sql on kubernetes demystifiedMy sql on kubernetes demystified
My sql on kubernetes demystified
Marco Tusa
 
Accessing data through hibernate: what DBAs should tell to developers and vic...
Accessing data through hibernate: what DBAs should tell to developers and vic...Accessing data through hibernate: what DBAs should tell to developers and vic...
Accessing data through hibernate: what DBAs should tell to developers and vic...
Marco Tusa
 
Best practice-high availability-solution-geo-distributed-final
Best practice-high availability-solution-geo-distributed-finalBest practice-high availability-solution-geo-distributed-final
Best practice-high availability-solution-geo-distributed-final
Marco Tusa
 
MySQL innoDB split and merge pages
MySQL innoDB split and merge pagesMySQL innoDB split and merge pages
MySQL innoDB split and merge pages
Marco Tusa
 
Robust ha solutions with proxysql
Robust ha solutions with proxysqlRobust ha solutions with proxysql
Robust ha solutions with proxysql
Marco Tusa
 
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Marco Tusa
 
Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...
Marco Tusa
 
Improve aws withproxysql
Improve aws withproxysqlImprove aws withproxysql
Improve aws withproxysql
Marco Tusa
 
Fortify aws aurora_proxy
Fortify aws aurora_proxyFortify aws aurora_proxy
Fortify aws aurora_proxy
Marco Tusa
 
Geographically dispersed perconaxtra db cluster deployment
Geographically dispersed perconaxtra db cluster deploymentGeographically dispersed perconaxtra db cluster deployment
Geographically dispersed perconaxtra db cluster deployment
Marco Tusa
 
Sync rep aurora_2016
Sync rep aurora_2016Sync rep aurora_2016
Sync rep aurora_2016
Marco Tusa
 
Empower my sql server administration with 5.7 instruments
Empower my sql server administration with 5.7 instrumentsEmpower my sql server administration with 5.7 instruments
Empower my sql server administration with 5.7 instruments
Marco Tusa
 
Plmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_finalPlmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_final
Marco Tusa
 
Discard inport exchange table & tablespace
Discard inport exchange table & tablespaceDiscard inport exchange table & tablespace
Discard inport exchange table & tablespace
Marco Tusa
 
MySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMySQL cluster 72 in the Cloud
MySQL cluster 72 in the Cloud
Marco Tusa
 
MySQL developing Store Procedure
MySQL developing Store ProcedureMySQL developing Store Procedure
MySQL developing Store Procedure
Marco Tusa
 
MySQL overview
MySQL overviewMySQL overview
MySQL overview
Marco Tusa
 
Oracle to MySQL 2012
Oracle to MySQL  2012 Oracle to MySQL  2012
Oracle to MySQL 2012
Marco Tusa
 
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Marco Tusa
 
My sql on kubernetes demystified
My sql on kubernetes demystifiedMy sql on kubernetes demystified
My sql on kubernetes demystified
Marco Tusa
 
Accessing data through hibernate: what DBAs should tell to developers and vic...
Accessing data through hibernate: what DBAs should tell to developers and vic...Accessing data through hibernate: what DBAs should tell to developers and vic...
Accessing data through hibernate: what DBAs should tell to developers and vic...
Marco Tusa
 
Best practice-high availability-solution-geo-distributed-final
Best practice-high availability-solution-geo-distributed-finalBest practice-high availability-solution-geo-distributed-final
Best practice-high availability-solution-geo-distributed-final
Marco Tusa
 
MySQL innoDB split and merge pages
MySQL innoDB split and merge pagesMySQL innoDB split and merge pages
MySQL innoDB split and merge pages
Marco Tusa
 
Robust ha solutions with proxysql
Robust ha solutions with proxysqlRobust ha solutions with proxysql
Robust ha solutions with proxysql
Marco Tusa
 
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Accessing Data Through Hibernate; What DBAs Should Tell Developers and Vice V...
Marco Tusa
 
Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...
Marco Tusa
 
Improve aws withproxysql
Improve aws withproxysqlImprove aws withproxysql
Improve aws withproxysql
Marco Tusa
 
Fortify aws aurora_proxy
Fortify aws aurora_proxyFortify aws aurora_proxy
Fortify aws aurora_proxy
Marco Tusa
 
Geographically dispersed perconaxtra db cluster deployment
Geographically dispersed perconaxtra db cluster deploymentGeographically dispersed perconaxtra db cluster deployment
Geographically dispersed perconaxtra db cluster deployment
Marco Tusa
 
Sync rep aurora_2016
Sync rep aurora_2016Sync rep aurora_2016
Sync rep aurora_2016
Marco Tusa
 
Empower my sql server administration with 5.7 instruments
Empower my sql server administration with 5.7 instrumentsEmpower my sql server administration with 5.7 instruments
Empower my sql server administration with 5.7 instruments
Marco Tusa
 
Plmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_finalPlmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_final
Marco Tusa
 
Discard inport exchange table & tablespace
Discard inport exchange table & tablespaceDiscard inport exchange table & tablespace
Discard inport exchange table & tablespace
Marco Tusa
 
MySQL cluster 72 in the Cloud
MySQL cluster 72 in the CloudMySQL cluster 72 in the Cloud
MySQL cluster 72 in the Cloud
Marco Tusa
 
MySQL developing Store Procedure
MySQL developing Store ProcedureMySQL developing Store Procedure
MySQL developing Store Procedure
Marco Tusa
 
MySQL overview
MySQL overviewMySQL overview
MySQL overview
Marco Tusa
 
Oracle to MySQL 2012
Oracle to MySQL  2012 Oracle to MySQL  2012
Oracle to MySQL 2012
Marco Tusa
 
Ad

Recently uploaded (20)

mid-term all revisions g11 s1.pmdzs,zxptx
mid-term all revisions g11 s1.pmdzs,zxptxmid-term all revisions g11 s1.pmdzs,zxptx
mid-term all revisions g11 s1.pmdzs,zxptx
omar164646
 
Emirates Agriculture Prensentation Badges GOLD.pdf
Emirates Agriculture Prensentation Badges GOLD.pdfEmirates Agriculture Prensentation Badges GOLD.pdf
Emirates Agriculture Prensentation Badges GOLD.pdf
asfianoor1
 
The Irrational City | Unseen Forces of Placemaking
The Irrational City | Unseen Forces of PlacemakingThe Irrational City | Unseen Forces of Placemaking
The Irrational City | Unseen Forces of Placemaking
Leanne Munyori
 
Take this ppt refference and give content on mahindra commitment to sustainab...
Take this ppt refference and give content on mahindra commitment to sustainab...Take this ppt refference and give content on mahindra commitment to sustainab...
Take this ppt refference and give content on mahindra commitment to sustainab...
kochars428
 
STOCK ANALYSYS.pptx manajemen keuangan s
STOCK ANALYSYS.pptx manajemen keuangan sSTOCK ANALYSYS.pptx manajemen keuangan s
STOCK ANALYSYS.pptx manajemen keuangan s
kfdpontianak2012
 
interpolacrcrdcrdrcrdctctfct frfctfction.ppt
interpolacrcrdcrdrcrdctctfct frfctfction.pptinterpolacrcrdcrdrcrdctctfct frfctfction.ppt
interpolacrcrdcrdrcrdctctfct frfctfction.ppt
pawan070201
 
4K Video Downloader Crack (2025) + License Key Free
4K Video Downloader Crack (2025) + License Key Free4K Video Downloader Crack (2025) + License Key Free
4K Video Downloader Crack (2025) + License Key Free
Designer
 
Minimalist Pitch Deck by slide Slidesgo.pptx
Minimalist Pitch Deck by slide Slidesgo.pptxMinimalist Pitch Deck by slide Slidesgo.pptx
Minimalist Pitch Deck by slide Slidesgo.pptx
ESTEFANOANDREYGARCIA
 
Steam-Education-PowerPoint-Templates.pptx
Steam-Education-PowerPoint-Templates.pptxSteam-Education-PowerPoint-Templates.pptx
Steam-Education-PowerPoint-Templates.pptx
andripapa1
 
OLADIMEJI FAKOREDE ARCT 1073 BUILDING DESIGN PORTFOLIO_compressed.pdf
OLADIMEJI FAKOREDE ARCT 1073 BUILDING DESIGN PORTFOLIO_compressed.pdfOLADIMEJI FAKOREDE ARCT 1073 BUILDING DESIGN PORTFOLIO_compressed.pdf
OLADIMEJI FAKOREDE ARCT 1073 BUILDING DESIGN PORTFOLIO_compressed.pdf
DimejiFakorede
 
Minimalist Business Slides XL by Slidesgo.pptx
Minimalist Business Slides XL by Slidesgo.pptxMinimalist Business Slides XL by Slidesgo.pptx
Minimalist Business Slides XL by Slidesgo.pptx
karenalavamoran
 
behiriskfactorsxyzkskeb210217133906 (1).pdf
behiriskfactorsxyzkskeb210217133906 (1).pdfbehiriskfactorsxyzkskeb210217133906 (1).pdf
behiriskfactorsxyzkskeb210217133906 (1).pdf
ShakibulHasan14
 
Naan mudalvan assignment for students_064143.pptx
Naan mudalvan assignment for  students_064143.pptxNaan mudalvan assignment for  students_064143.pptx
Naan mudalvan assignment for students_064143.pptx
NaziaFarheen13
 
EEE178-PPT-Theme iasodhajsdkjashdlaskdjbaksdkashdlkasdlkja;dj;kdada.pptx.pdf
EEE178-PPT-Theme iasodhajsdkjashdlaskdjbaksdkashdlkasdlkja;dj;kdada.pptx.pdfEEE178-PPT-Theme iasodhajsdkjashdlaskdjbaksdkashdlkasdlkja;dj;kdada.pptx.pdf
EEE178-PPT-Theme iasodhajsdkjashdlaskdjbaksdkashdlkasdlkja;dj;kdada.pptx.pdf
CastroAngeloReoD
 
MOCCAE SUSTAINABLE TROPHY 2025 Presentation.pdf
MOCCAE SUSTAINABLE TROPHY 2025 Presentation.pdfMOCCAE SUSTAINABLE TROPHY 2025 Presentation.pdf
MOCCAE SUSTAINABLE TROPHY 2025 Presentation.pdf
asfianoor1
 
masterddedeeeeeeeeedded seminar (1).pptx
masterddedeeeeeeeeedded seminar (1).pptxmasterddedeeeeeeeeedded seminar (1).pptx
masterddedeeeeeeeeedded seminar (1).pptx
tgavel7869
 
Designing Interactive and Engaging Museum Exhibits
Designing Interactive and Engaging Museum ExhibitsDesigning Interactive and Engaging Museum Exhibits
Designing Interactive and Engaging Museum Exhibits
Peach Prime Consultancy
 
presentation on healing architecture .pptx
presentation on healing architecture .pptxpresentation on healing architecture .pptx
presentation on healing architecture .pptx
buildnpl
 
Halstead’s_Software_Science_&_Putnam’s_Model[1].pptx
Halstead’s_Software_Science_&_Putnam’s_Model[1].pptxHalstead’s_Software_Science_&_Putnam’s_Model[1].pptx
Halstead’s_Software_Science_&_Putnam’s_Model[1].pptx
prachiikumarii1
 
dFdDVWeb_Design_Basics_Presentation.pptx
dFdDVWeb_Design_Basics_Presentation.pptxdFdDVWeb_Design_Basics_Presentation.pptx
dFdDVWeb_Design_Basics_Presentation.pptx
AKSHAYKAMBLE806728
 
mid-term all revisions g11 s1.pmdzs,zxptx
mid-term all revisions g11 s1.pmdzs,zxptxmid-term all revisions g11 s1.pmdzs,zxptx
mid-term all revisions g11 s1.pmdzs,zxptx
omar164646
 
Emirates Agriculture Prensentation Badges GOLD.pdf
Emirates Agriculture Prensentation Badges GOLD.pdfEmirates Agriculture Prensentation Badges GOLD.pdf
Emirates Agriculture Prensentation Badges GOLD.pdf
asfianoor1
 
The Irrational City | Unseen Forces of Placemaking
The Irrational City | Unseen Forces of PlacemakingThe Irrational City | Unseen Forces of Placemaking
The Irrational City | Unseen Forces of Placemaking
Leanne Munyori
 
Take this ppt refference and give content on mahindra commitment to sustainab...
Take this ppt refference and give content on mahindra commitment to sustainab...Take this ppt refference and give content on mahindra commitment to sustainab...
Take this ppt refference and give content on mahindra commitment to sustainab...
kochars428
 
STOCK ANALYSYS.pptx manajemen keuangan s
STOCK ANALYSYS.pptx manajemen keuangan sSTOCK ANALYSYS.pptx manajemen keuangan s
STOCK ANALYSYS.pptx manajemen keuangan s
kfdpontianak2012
 
interpolacrcrdcrdrcrdctctfct frfctfction.ppt
interpolacrcrdcrdrcrdctctfct frfctfction.pptinterpolacrcrdcrdrcrdctctfct frfctfction.ppt
interpolacrcrdcrdrcrdctctfct frfctfction.ppt
pawan070201
 
4K Video Downloader Crack (2025) + License Key Free
4K Video Downloader Crack (2025) + License Key Free4K Video Downloader Crack (2025) + License Key Free
4K Video Downloader Crack (2025) + License Key Free
Designer
 
Minimalist Pitch Deck by slide Slidesgo.pptx
Minimalist Pitch Deck by slide Slidesgo.pptxMinimalist Pitch Deck by slide Slidesgo.pptx
Minimalist Pitch Deck by slide Slidesgo.pptx
ESTEFANOANDREYGARCIA
 
Steam-Education-PowerPoint-Templates.pptx
Steam-Education-PowerPoint-Templates.pptxSteam-Education-PowerPoint-Templates.pptx
Steam-Education-PowerPoint-Templates.pptx
andripapa1
 
OLADIMEJI FAKOREDE ARCT 1073 BUILDING DESIGN PORTFOLIO_compressed.pdf
OLADIMEJI FAKOREDE ARCT 1073 BUILDING DESIGN PORTFOLIO_compressed.pdfOLADIMEJI FAKOREDE ARCT 1073 BUILDING DESIGN PORTFOLIO_compressed.pdf
OLADIMEJI FAKOREDE ARCT 1073 BUILDING DESIGN PORTFOLIO_compressed.pdf
DimejiFakorede
 
Minimalist Business Slides XL by Slidesgo.pptx
Minimalist Business Slides XL by Slidesgo.pptxMinimalist Business Slides XL by Slidesgo.pptx
Minimalist Business Slides XL by Slidesgo.pptx
karenalavamoran
 
behiriskfactorsxyzkskeb210217133906 (1).pdf
behiriskfactorsxyzkskeb210217133906 (1).pdfbehiriskfactorsxyzkskeb210217133906 (1).pdf
behiriskfactorsxyzkskeb210217133906 (1).pdf
ShakibulHasan14
 
Naan mudalvan assignment for students_064143.pptx
Naan mudalvan assignment for  students_064143.pptxNaan mudalvan assignment for  students_064143.pptx
Naan mudalvan assignment for students_064143.pptx
NaziaFarheen13
 
EEE178-PPT-Theme iasodhajsdkjashdlaskdjbaksdkashdlkasdlkja;dj;kdada.pptx.pdf
EEE178-PPT-Theme iasodhajsdkjashdlaskdjbaksdkashdlkasdlkja;dj;kdada.pptx.pdfEEE178-PPT-Theme iasodhajsdkjashdlaskdjbaksdkashdlkasdlkja;dj;kdada.pptx.pdf
EEE178-PPT-Theme iasodhajsdkjashdlaskdjbaksdkashdlkasdlkja;dj;kdada.pptx.pdf
CastroAngeloReoD
 
MOCCAE SUSTAINABLE TROPHY 2025 Presentation.pdf
MOCCAE SUSTAINABLE TROPHY 2025 Presentation.pdfMOCCAE SUSTAINABLE TROPHY 2025 Presentation.pdf
MOCCAE SUSTAINABLE TROPHY 2025 Presentation.pdf
asfianoor1
 
masterddedeeeeeeeeedded seminar (1).pptx
masterddedeeeeeeeeedded seminar (1).pptxmasterddedeeeeeeeeedded seminar (1).pptx
masterddedeeeeeeeeedded seminar (1).pptx
tgavel7869
 
Designing Interactive and Engaging Museum Exhibits
Designing Interactive and Engaging Museum ExhibitsDesigning Interactive and Engaging Museum Exhibits
Designing Interactive and Engaging Museum Exhibits
Peach Prime Consultancy
 
presentation on healing architecture .pptx
presentation on healing architecture .pptxpresentation on healing architecture .pptx
presentation on healing architecture .pptx
buildnpl
 
Halstead’s_Software_Science_&_Putnam’s_Model[1].pptx
Halstead’s_Software_Science_&_Putnam’s_Model[1].pptxHalstead’s_Software_Science_&_Putnam’s_Model[1].pptx
Halstead’s_Software_Science_&_Putnam’s_Model[1].pptx
prachiikumarii1
 
dFdDVWeb_Design_Basics_Presentation.pptx
dFdDVWeb_Design_Basics_Presentation.pptxdFdDVWeb_Design_Basics_Presentation.pptx
dFdDVWeb_Design_Basics_Presentation.pptx
AKSHAYKAMBLE806728
 

Mysql8 advance tuning with resource group

  • 1. Mysql8 advance tuning with Resource Group Marco Tusa Percona
  • 2. 2 About me Marco “The Grinch” • Former UN, MySQL AB, Pythian, Percona • 2 kids, 1 wife • History of Religions; Ski; Snowboard; Scuba Diving;
  • 3. 3 My Motto Use the Right Tool for the Job
  • 4. 4 Summary 1. Resource Group overview 1. RG Attributes 2. RG Management 3. RG limitations/warning 2. Real case to solve 3. The recipe 1. Implement it 4. Tests … and more tests 5. Conclusions
  • 5. 5 Distribute load • Multicore CPUs • OS supporting multicore • Application written for parallelism (multi threading) • MySQL Thread-Connection • ProxyMySQL (multiplexing) OR connection pooling
  • 6. 6 Resource Group Attributes (root@localhost) [information_schema]>describe resource_groups; +------------------------+-----------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------------+-----------------------+------+-----+---------+-------+ | RESOURCE_GROUP_NAME | varchar(64) | NO | | NULL | | | RESOURCE_GROUP_TYPE | enum('SYSTEM','USER') | NO | | NULL | | | RESOURCE_GROUP_ENABLED | tinyint(1) | NO | | NULL | | | VCPU_IDS | blob | YES | | NULL | | | THREAD_PRIORITY | int(11) | NO | | NULL | | +------------------------+-----------------------+------+-----+---------+-------+
  • 7. 7 Resource Group Management • GRANT RESOURCE_GROUP_ADMIN,RESOURCE_GROUP_USER • STATUS • Com_alter_resource_group • Com_create_resource_group • Com_drop_resource_group drop RESOURCE GROUP Select_app2; CREATE RESOURCE GROUP Select_app2 TYPE=USER VCPU=5 THREAD_PRIORITY=19; ALTER RESOURCE GROUP Select_app2 VCPU = 1 THREAD_PRIORITY = 19
  • 8. 8 Resource Group Management For system resource groups, the permitted priority range is -20 to 0. For user resource groups, the permitted priority range is 0 to 19. Priority Range Windows Priority Level -20 to -10 THREAD_PRIORITY_HIGHEST -9 to -1 THREAD_PRIORITY_ABOVE_NORMAL 0 THREAD_PRIORITY_NORMAL 1 to 10 THREAD_PRIORITY_BELOW_NORMAL 11 to 19 THREAD_PRIORITY_LOWEST
  • 9. 9 Resource Group Management To assign a thread to the Batch group: SET RESOURCE GROUP Select_app2 FOR thread_id; If a session's own current thread should be in the Batch group, execute this statement within the session: SET RESOURCE GROUP Select_app2; To execute a single statement using the Batch group, use the RESOURCE_GROUP optimizer hint: INSERT /*+ RESOURCE_GROUP(Select_app2) */ INTO t2 VALUES(2);
  • 10. 10 Resource Group Warning • Resource group management is local to the server on which it occurs. No replication • Resource groups are unavailable if the thread pool plugin is installed • On FreeBSD and Solaris, resource group thread priorities are ignored. • Linux CAP_SYS_NICE capability must be set. • sudo setcap cap_sys_nice+ep <Path to you mysqld executable> getcap ./bin/mysqld ./bin/mysqld = cap_sys_nice+ep
  • 11. 11 The case I have a very noisy secondary application written by a very, very bad developer that accesses my servers, mostly with read queries, and occasionally with write updates. Reads and writes are obsessive and create an impact on the MAIN application. My task is to limit the impact of this secondary application without having the main one affected. To do that I will create two resource groups, one for WRITE and another for READ. The first group, Write_app2, will have no cpu affiliation, but will have lowest priority.
  • 12. 12 The recipe • Two users • App1 (good guy) • App2 (nasty bad developer) • Master – Slave pair • 2 Set of Resource group settings (Master/Slave) • ProxySQL • 2 Host groups • Query rules fro read/write split • Query rules fro Query rewrite
  • 13. 13 How to implement it • MySQL • CREATE RESOURCE GROUP Write_app2 TYPE=USER THREAD_PRIORITY=19; • CREATE RESOURCE GROUP Select_app2 TYPE=USER VCPU=5 THREAD_PRIORITY=19; • ProxySQL • insert into mysql_users … values ('app2','test',1,80,'mysql',1); insert into mysql_users … values ('app1','test',1,80,'mysql',1); • insert into mysql_query_rules …values(80,6033,'app1',80,1,3,'^SELECT.*FOR UPDATE',1,1); insert into mysql_query_rules… values(81,6033,'app1',81,1,3,'^SELECT.*',1,1); insert into mysql_query_rules ... values(82,6033,'app2',80,1,3,'^SELECT.*FOR UPDATE',1,1); insert into mysql_query_rules ... values(83,6033,'app2',81,1,3,'^SELECT.*',1,1); • INSERT INTO mysql_query_rules … VALUES (32,1,'app2',"(^SELECT)s*(.*$)","1 /*+ RESOURCE_GROUP(Select_app2) */ 2 ",0,"Lower prio and CPU bound on Reader"); • INSERT INTO mysql_query_rules … VALUES (33,1,'app2',"^(INSERT|UPDATE|DELETE)s*(.*$)","1 /*+ RESOURCE_GROUP(Write_app2) */ 2 ",0,"Lower prio on Writer");
  • 14. 14 Testing the whole thing • test1 run both apps with read/write and rule disabled for RG • test2 run only App2 without & with RG to see the cost on the execution • test3 run both to see what happen with RG
  • 15. 15 Results Test1 - CPU Master Slave
  • 16. 16 Results Test1 - CRUD App 1 App 2 9 15464 4241 1333 165 308 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 1 #EVENTS EVENT BY APPLICATION AND TYPE OF CRUD # Events by CRUD and Application #Insert events App1 #Update events App1 #Update events App2 #Delete events App1 #Select events App1 #Select events App2
  • 17. 17 Results Test1 - time 69016 5372 4564 29626 10780 10835 0 10000 20000 30000 40000 50000 60000 70000 80000 1 EXECUTIONAVERAGEINMS EXECUTION PER CRUD OPERATION APP1 AND APP2 Execution time Insert Exec time App1 Update Exec time App1 Update Exec time App2 Delete Exec time App1 Select Exec time App1 Select Exec time App2
  • 18. 18 Results Test2 - CPU Master only nasty APP no LIMIT Master only nasty APP WITH LIMIT
  • 19. 19 Results Test2 - CPU Slave only nasty APP no LIMIT Slave only nasty APP WITH LIMIT
  • 20. 20 Results Test2 - CRUD Test without limit Test with limit
  • 21. 21 Results Test2 - time Test without limit Test with limit
  • 22. 22 Results Test3 - CPU Master Slave
  • 23. 25 Compare Before VS After - CRUD Test without limit Test with limit
  • 24. 26 Compare Before VS After - time Test without limit Test with limit
  • 25. 27 Conclusions • Mission accomplished • Resource group is a simple but not easy to use feature • Must be used in conjunction with something like ProxySQL or if you want to use on the thread a smart scripting • Doesn’t work well with Connection Pooling • You will not get it right at the first attempt so: • Work on test environment first • Test Test Test • Keep production under observation for a long while to be sure you are not creating a mess • Use it as Last Man Standing option