SlideShare uma empresa Scribd logo
1 de 109
Baixar para ler offline
MySQL
Advanced Administrator
㈜네오클로바
▶ 2021. 06
Next Opensource Cloud Value
MySQL Optimization
241
MySQL Optimization
• Hardware
– CPU
 single processing
 빠른 Processor ( Fast Clock Speed)
 bus speed, cache size
 More Cores
– Memory
 슬롯당 최대 RAM Size 우선선택
– Disk
 빠른 Disk speed
 redo / undo / binary log 전용 디스크
242
MySQL Optimization
• Linux
– IO scheduler
– Open files / core file size
– Swappiness
243
MySQL Optimization
• Configuration (my.cnf)
244
MySQL Optimization
• SQL 튜닝
– SQL 수행을 위한 실행계획 확인
– 최적의 실행계획을 위한 적절한 INDEX 확인
– PRIMARY KEY & SECONDARY KEY
– JOIN
– EXPLAIN
245
MySQL Optimization
• Primary Key
– PK 없으면 6bytes 더미 PK 컬럼 생성
– secondary key lookup
– sql_require_primary_key 설정
http://philipzhong.blogspot.com/2011/06/how-to-improve-mysql-select-count.html
246
MySQL Optimization
• Secondary Key
– leaf node에 PK 포함
– key lookup 통해서 PK 데이터를 검색
– Covered Index
https://www.slideshare.net/mysqlops/innodb-internal-9032556
247
MySQL Optimization
• JOIN
– 모든 SQL Single processing
– 오직 Nested Loop Join
– 조인 컬럼을 가지고
Driving Table에서
Driven Table 접근
https://mariadb.com/kb/en/semi-join-materialization-strategy/
248
MySQL Optimization
• EXPLAIN
– slow query 확인
– 옵티마이저의 변환
– 적절한 조인 순서
– 인덱스 확인
– SQL 수정 판단
컬럼 설명
id 한 테이블의 SELECT 번호, 쿼리내의 SELECT의 구분번호
select_type SELECT의 타입(SIMPLE, PRIMARY, UNION, SUBQUERY, DRIVED, …)
table 해당 table명
type 조인의 타입(system, const, eq_ref, ref, ref_or_null, …)
passible_keys 테이블의 사용 가능한 인덱스들 명
key Passible_keys 값들 중에서 실제 사용한 인덱스(key)
Key_len Where절에 사용한 인덱스의 길이(byte)
ref 행을 추출하는데 key와 함께 사용한 컬럼 이나 상수
rows 쿼리수행을 위해 검사대상 예상행수
filtered 조건절에 의해 필터링 되는 행의 비율
extra 쿼리를 해석한 추가적인 정보
249
MySQL Optimization
• Query Analysis
– Use EXPLAIN to see how MariaDB Executes a Troublesome Query and if Indexes are Used
– Use EXPLAIN EXTENDED and SHOW WARNINGS to see how MariaDB Rearranges a Query before Execution
250
MySQL Optimization
• select_type
– SIMPLE : UNION 이나 SUBQUERY를 사용하지 않는 단순 SELECT
– PRIMARY : 쿼리 제일 바깥쪽에 있는 SELECT
– DERIVED : SELECT절로 추출된 테이블로 FROM절 내부의 SUBQUERY의미
– UNION : UNION절에서 두번째 이후 SELECT, 첫번째는 DRIVED
– DEPENDENT UNION : 내부 쿼리가 외부 값을 참조하는 UNION절 테이블
– UNION RESULT : UNION 결과 값에 대한 임시 테이블
– SUBQUERY : FROM절 이외의 서브 쿼리 의미
– DEPENDENT SUBQUERY : 서브쿼리가 바깥쪽 SELECT절의 컬럼 값을 참조
– UNCHACHEABLE SUBQUERY : 서브쿼리 결과가 외부 쿼리의 변하는 값에 따라 매번 새로 생성
– UNCHACHEABLE UNION : 캐싱이 불가능한 요소를 포함한 UNION
251
MySQL Optimization
• Scan or Index Method types
– const : A constant value can be read once and cached
– eq_ref : One index access per outer query row
– ref : Multiple index accesses per outer query row
– index_merge : Multiple indexes used, merging into a single result set
– range : Multiple index accesses to return all rows within a range
– index : Full index scan (every index entry is read sequentially)
– all : Full table scan (every record is read sequentially)
252
MySQL Optimization
• Analyze Columns
– Analyze Columns with PROCEDURE ANALYSE()
– Use PROCEDURE ANALYSE() for Data Type Recommendations
253
MySQL Optimization
• Indexes for Performance Optimization
– MariaDB can Resolve Queries Faster with Indexes
Faster Retrieval of Matching Rows, Faster Sorting of Result Sets
Without Indexes, MariaDB does Full Table Scan
– Indexes can be for a Column or Multiple Columns (i.e.,Composites)
– Index for Speed, but Avoid Indexing Excessively or Arbitrarily
– Remove Unused or Redundant Indexes
254
MySQL Optimization
• Create Table Indexes
– Use ALTER TABLE or CREATE INDEX to add an Index
– Keep Indexes as Small as Practical
– For Indexing Strings, Use Prefix
255
MySQL Optimization
• Better JOIN Construction
– Foreign Keys used with Joins should be Indexed
– Index Columns in ON and USING Clauses
– Keep GROUP BY and ORDER BY columns in one Table for better Indexing
256
MySQL Optimization
• InnoDB 제약 조건
– InnoDB tables can have a maximum of 1,017 columns
– The maximum size for BLOB and TEXT columns is 4GB. This also applies to LONGBLOB and LONGTEXT
– MariaDB imposes a row-size limit of 65,535 bytes for the combined sizes of all columns
– The innodb_large_prefix system variable enables large prefix sizes
That is, when enabled InnoDB uses 3072B index key prefixes for DYNAMIC and COMPRESSED row formats
When disabled, it uses 787B key prefixes for tables of any row format
Next Opensource Cloud Value
MySQL
information_schema
258
MySQL information_schema
• 메타데이터를 저장하는 데이터베이스/스키마
– 읽기 전용, 버전 별로 테이블 수가 다름
• 가상 데이터베이스
– Datadir에 폴더가 없음
• metadata 정보를 얻기 위해 SELECT사용
259
MySQL information_schema
 Tables in information_schema
설명
CHARACTER_SETS 사용 가능한 캐릭터 셋
COLLATIONS 각각의 캐릭터 셋을 위한 콜래이션
COLUMNS 테이블 안에 컬럼
COLUMN_PRIVILEGES 컬럼 권한은 사용자 계정에 의해서 따름
ENGINES 스토리지 엔진
EVENTS 스케줄된 이벤트
KEY_COLUMN_USAGE 키 컬럼 제한
PARTITIONS 테이블 파티션
PLUGINS 서버 플러그인
260
MySQL information_schema
 Tables in information_schema
설명
PROCESSLIST 실행중인 스레드 확인 하기
REFERENTIAL_CONSTRAINTS foreign keys
ROUTINES 저장 프로시저와 함수
SCHEMATA 데이터베이스
SCHEMA_PRIVILEGES 데이터베이스 권한은 사용자 계정에 따름
STATISTICS 테이블 통계
TABLES 데이터베이스 안에 테이블
TABLE_CONSTRAINTS 테이블 제약
TABLE_PRIVILEGES 테이블 권한은 사용자 계정에 따름
261
MySQL information_schema
 Tables in information_schema
설명
TRIGGERS 트리거
USER_PRIVILEGES 전역 권한은 사용자 권한에 따름
VIEWS 뷰
INNODB_LOCKS 트랜잭션의 잠금 요청에 대한 대기정보 및 차단하는 정보
INNODB_LOCK_WAITS 트랜잭션 차단된 대기정보
INNODB_TRX 실행중인 트랜잭션 정보
TokuDB_file_map TokuDB 디렉토리명 및 테이블, 인덱스 파일명
262
MySQL information_schema
• 데이터베이스별 엔진
• 시스템 변수 확인
263
MySQL information_schema
• Foreign key 확인
• InnoDB lock 확인
264
MySQL information_schema
• 데이터베이스 사용량
• 테이블 사용량
265
MySQL information_schema
• Primary key 확인
https://www.vertabelo.com/blog/querying-mysqls-information-schema-why-how/
266
MySQL information_schema
• Index 확인
267
MySQL information_schema
• Index 사용량
http://code.openark.org/blog/mysql/useful-database-analysis-queries-with-information_schema
268
MySQL information_schema
• Character Set 확인
269
MySQL information_schema
• Processlist 확인
270
MySQL information_schema
 SHOW 명령
– SHOW DATABASES
– SHOW [FULL] TABLES
– SHOW [FULL] COLUMNS
– SHOW INDEX
– SHOW CHARACTER SET
– SHOW COLLATION
– SHOW Engines
– SHOW Plugins
Next Opensource Cloud Value
MySQL
performance_schema
272
MySQL performance_schema
The MySQL Performance Schema is a feature for monitoring MySQL Server execution at a low level
my.cnf
performance_schema = ON
인스턴스의 모니터링
- 내부 실행중에 발생하는 이벤트를 검사, 모니터링
- 동적으로 수정 가능
- 메모리 내 저장, 종료 시 삭제
주요 특징
- 복제 대상 아님
- 활성화 시 수집 지표에 따라 5~15% 성능저하
- 구문분석, 실행계획 등에 영향 없음
273
MySQL performance_schema
• setup_consumers 설정
- 모니터링 하고자 하는 계측테이블을 활성화
• setup_instruments 설정
- 모니터링 하고자 하는 계측기 활성화
274
MySQL performance_schema
• user, host, accounts 확인
• 실행 쿼리 확인
275
MySQL performance_schema
• 실행 thread 확인
• IO wait 많은 테이블 확인
- sum_timer_wait 등 time 정보는 picoseconds (1 * 10 ^ 12)
276
MySQL performance_schema
• 수행 시간이 오래 걸린 SQL
• 파일별 IO wait
Next Opensource Cloud Value
MySQL
sys schema
278
MySQL sys schema
MySQL 8.0 includes the sys schema, a set of objects that helps DBAs and developers interpret data
collected by the Performance Schema. sys schema objects can be used for typical tuning and diagnosis
use cases. Objects in this schema include:
• Views that summarize Performance Schema data into more easily understandable form
• Stored procedures that perform operations such as Performance Schema configuration and generating
diagnostic reports
• Stored functions that query Performance Schema configuration and provide formatting services
https://dev.mysql.com/doc/refman/8.0/en/sys-schema.html
279
MySQL sys schema
설명
sys_config sys schema configuration options table
host_summary Statement activity, file I/O, and connections, grouped by host
host_summary_by_file_io File I/O, grouped by host
host_summary_by_file_io_type File I/O, grouped by host and event type
host_summary_by_stages Statement stages, grouped by host
host_summary_by_statement_latency Statement statistics, grouped by host
host_summary_by_statement_type Statements executed, grouped by host and statement
innodb_buffer_stats_by_schema InnoDB buffer information, grouped by schema
innodb_buffer_stats_by_table InnoDB buffer information, grouped by schema and table
innodb_lock_waits InnoDB lock information
280
MySQL sys schema
설명
io_by_thread_by_latency I/O consumers, grouped by thread
io_global_by_file_by_bytes Global I/O consumers, grouped by file and bytes
io_global_by_file_by_latency Global I/O consumers, grouped by file and latency
io_global_by_wait_by_bytes Global I/O consumers, grouped by bytes
io_global_by_wait_by_latency Global I/O consumers, grouped by latency
latest_file_io Most recent I/O, grouped by file and thread
memory_by_host_by_current_bytes Memory use, grouped by host
memory_by_thread_by_current_bytes Memory use, grouped by thread
memory_by_user_by_current_bytes Memory use, grouped by user
memory_global_by_current_bytes Memory use, grouped by allocation type
281
MySQL sys schema
설명
memory_global_total Total memory use
metrics Server metrics
processlist Processlist information
ps_check_lost_instrumentation Variables that have lost instruments
schema_auto_increment_columns AUTO_INCREMENT column information
schema_index_statistics Index statistics
schema_object_overview Types of objects within each schema
schema_redundant_indexes Duplicate or redundant indexes
schema_table_lock_waits Sessions waiting for metadata locks
schema_table_statistics Table statistics
282
MySQL sys schema
설명
schema_table_statistics_with_buffer Table statistics, including InnoDB buffer pool statistics
schema_tables_with_full_table_scans Tables being accessed with full scans
schema_unused_indexes Indexes not in active use
session Processlist information for user sessions
session_ssl_status Connection SSL information
statement_analysis Statement aggregate statistics
statements_with_errors_or_warnings Statements that have produced errors or warnings
statements_with_full_table_scans Statements that have done full table scans
statements_with_runtimes_in_95th_percent
ile
Statements with highest average runtime
statements_with_sorting Statements that performed sorts
283
MySQL sys schema
설명
statements_with_temp_tables Statements that used temporary tables
user_summary User statement and connection activity
user_summary_by_file_io File I/O, grouped by user
user_summary_by_file_io_type File I/O, grouped by user and event
user_summary_by_stages Stage events, grouped by user
user_summary_by_statement_latency Statement statistics, grouped by user
user_summary_by_statement_type Statements executed, grouped by user and statement
wait_classes_global_by_avg_latency Wait class average latency, grouped by event class
wait_classes_global_by_latency Wait class total latency, grouped by event class
waits_by_host_by_latency Wait events, grouped by host and event
284
MySQL sys schema
설명
waits_by_user_by_latency Wait events, grouped by user and event
waits_global_by_latency Wait events, grouped by event
x$ps_digest_95th_percentile_by_avg_us Helper view for 95th-percentile views
x$ps_digest_avg_latency_distribution Helper view for 95th-percentile views
x$ps_schema_table_statistics_io Helper view for table-statistics views
x$schema_flattened_keys Helper view for schema_redundant_indexes
Q&A
Next Opensource Cloud Value
Percona
287
Percona
Percona Server for MySQL
• All Percona Software is 100% Free and Open Source
• No Restricted “Enterprise” version
• MySQL과 기본적으로 구조 및 사용 방법 동일
• GPL v2 License
• Oracle로부터 자유로울 수 있음
https://percona.com/
288
Percona
Percona Server for MySQL
https://www.percona.com/blog/2016/03/17/percona-server-5-7-performance-improvements/
289
Percona
Percona Server for MySQL
Percona XtraDB Cluster
Percona XtraBackup
Percona Server for MongoDB
Percona Backup for MongoDB
Percona Distribution for PostgreSQL
Percona Monitoring and Management
Percona Kubernetes Operators
Percona Toolkit
Next Opensource Cloud Value
MariaDB
291
MariaDB Architecture
292
MariaDB Server Editions
293
MariaDB ecosystem
294
MariaDB Foundation
The MariaDB Foundation
The MariaDB Foundation supports continuity and open collaboration in the MariaDB ecosystem. The Foundation
guarantees that there is a global contact point for collaboration and that the community can always rely
upon MariaDB Server.
https://mariadb.org/
295
MariaDB Sea Lion
The Story of our Sea Lion
https://mariadb.org/sea-lion/
Our Founder Monty likes animals in the sea. For MySQL, he
picked a dolphin, after swimming with them in the Florida
Keys. For the MariaDB sea lion, there was a similar encounter.
It happened when Monty and his older daughter My were
snorkeling on one of the islands in the Galapagos. Something
big, brown and fast suddenly appeared at an arm’s distance,
laughing in their faces. Fond memories of this fast and funny
creature, scaring the tourists, popped into Monty’s mind when
asked picking a logo for MariaDB. He wanted to adhere to the
tradition of animals as symbols of Open Source projects.
296
MariaDB OpenSource
THE VALUE OF OPEN SOURCE
http://www.regist-event.com/event/2019/mariadb0925/200.%20open-source-
user%2020190925%20(Michael%20Monty%20Widenius).pdf
MySQL-MariaDB History talk
https://mariadb.org/wp-content/uploads/2019/11/MySQL-MariaDB-story.pdf
297
MariaDB OpenSource
Why MariaDB was created
“Save the People, Save the Product”
- To keep the MySQL talent together
- To ensure that a free version of MySQL always exists
- To get one community developed and maintained branch
- Work with other MySQL forks/branches to share knowhow and code
After Oracle announced it wanting to buy Sun & MySQL this got to be even more important.
298
MariaDB OpenSource
11 Reasons Open Source is Better than Closed Source
- Using open standards (no lock in into proprietary standards)
- Resource friendly; OSS software tend to work on old hardware
- Lower cost; Usually 1/10 of closed source software
- No cost for testing the full software
- Better documentation and more troubleshooting resources
- Better support, in many cases directly from the developers
- Better security, auditability (no trap doors and more eye balls)
- Better quality; Developed together with users
- Better customizability; You can also participate in development
- No vendor lock in; More than one vendor can give support
- When using open source, you take charge of your own future
299
MariaDB OpenSource
MariaDB is guaranteed to always be open source
- The MariaDB Foundation was created to ensure that anyone can be a contributor to the MariaDB project on
equal terms!
- The MariaDB Foundation is the owner of the main MariaDB server repositories on github
- The Foundation can never to be controlled by a single entity or person
- The Foundation is not about the MariaDB trademark or to decide upon the MariaDB roadmap!
300
MariaDB OpenSource
BUSINESS SOURCE LICENSE (DELAYED OPEN SOURCE)
- Not an Open Source license, but gives the users similar advantages as Open Source.
- Source code is available from the start. Anyone has the right to copy, modify & distribute but can't use
it commercially under some conditions you define.
- After X years the code automatically converts to some Open Source / Free license. The date has to be
explicitly set in all source code files to avoid misunderstandings.
- Better than Open Core as this removes the “one vendor” problem and the code will eventually be free.
- Investor friendly (as there is a way to force some users to pay).
301
MariaDB compatibility
Oracle compatibility
- MariaDB ups the stakes in database war with Oracle
- http://www.channelworld.in/news/mariadb-ups-stakes-database-war-oracle
- Michael Howard, who worked at Oracle for four years between 1996-2000, has been CEO of MariaDB since
December 2015.
- "Isn't it ironic that Oracle Enterprise, MySQL's bigger brother, provides data warehousing yet it is
MariaDB that is delivering it to you, this community? They don't want you to succeed with MySQL, they
certainly don't want MySQL to cannibalise things like Exadata."
302
MariaDB Storage Engine
 Aria
• Aria is a crash safe MyISAM + more
• This should speed up some GROUP BY and DISTINCT queries because Aria has better caching
than MyISAM
 FederatedX
• Transactions (beta feature)
• Supports partitions (alpha feature)
303
MariaDB Storage Engine - ColumnStore
• GPLv2 라이센스
• Columnar, Massively Parallel MariaDB Storage Engine
• 확장 가능한 고성능 분석 플랫폼
• Runs On premise, On AWS/Azure cloud or Hadoop HDFS cluster
• 플랫폼에 관계없이 전체 SQL구문 지원
MariaDB ColumnStore
304
MariaDB Storage Engine - ColumnStore
• 대용량 데이터 분석 엔진 & 플랫폼
- 1TB ~ 수PB의 대용량 데이터에 대한 고성능 분석 제공
- 필요한 컬럼 들만 질의 수행
- 다수의 디멘전 테이블의 조인
- MPP 구조의 다수 노드 구성 가능
- 복잡한 SQL 조인 지원, Windowing Functions 지원
305
MariaDB Storage Engine - ColumnStore
306
MariaDB Storage Engine - ColumnStore
307
MariaDB Storage Engine - ColumnStore
• USER MODULES
- mysqld : The MariaDB server
- ExeMgr : MariaDB’s interface to ColumnStore
- cpimport : high-performance data import
• QUERY PROCESSING - UM
- SQL Operations are translated into thousands of Primitives
- Parallel/Distributed SQL
- Extensible with Parallel/Distributed UDFs
- Query is parsed by mysqld on UM node
- Parsed query handed over to ExeMgr on UM node
- ExeMgr breaks down the query in primitive operations
308
MariaDB Storage Engine - ColumnStore
• PERFORMANCE MODULES
- PrimProc : Primitives Processor
- WriteEngineServer : Database file writing processor
- DMLProc : DML writes processor
- DDLProc : DDL processor
• QUERY PROCESSING - PM
- 블록 지향 읽기 및 쓰기 처리 지원 (I/O 작업)
- 분산 스캔, 분산 해시조인, 분산 집계를 통한 MPP 지원
- 공유 데이터 캐시 사용
309
MariaDB Storage Engine - Connect
310
MariaDB Storage Engine - Connect
• 주요 기능
- 외부 데이터 형식(DBMS, file, datasource, virtual) 연결
- ODBC, JDBC, MySQL or MongoDB API 통해 DataSource에 직접 연결
- JSON, XML, HTML파일 및 JSON UDF통한 NOSQL 쿼리지원
- WHERE절에 대한 푸시다운
- Special & Virtual Columns 지원
- 다중테이블의 병렬실행 가능
- 서브 테이블별 파티셔닝 지원
- SELECT, UPDATE 및 DELETE에 대한 MRR 지원
311
MariaDB Storage Engine - Connect
• PARAMETERS
- connect_class_path : java class path
- connect_conv_size : text유형 변환 시 varchar크기
- connect_enable_mongo : mongo table type enable
- connect_exact_info : 정확한 레코드번호 리턴 여부
- connect_index_map : 인덱스 파일에 대한 파일매핑 활성화여부
- connect_java_wrapper : java wrapper
- connect_json_grp_size : JSON 집계함수의 최대 행 수
- connect_json_null : JSON NULL값
- connect_jvm_path : JVM 경로
- connect_type_conv : TEXT 컬럼의 변환 처리 옵션
- connect_use_tempfile
- connect_work_size : 메모리할당에 사용되는 크기
- connect_xtrace : 콘솔추적값
312
MariaDB Storage Engine - Xpand
• Xpand (Clustrix)
- Xpand provides distributed SQL
- Xpand integrates with the Xpand storage engine in MariaDB Enterprise Server 10.5
- Xpand supports transactional workloads
- Xpand is strongly consistent
- Xpand leverages a shared-nothing architecture to efficiently execute distributed SQL
- Xpand provides high availability (HA) and fault tolerance by design
- Xpand scales out horizontally for both reads and writes
313
MariaDB Storage Engine - Xpand
• Distributed SQL
314
MariaDB Storage Engine - Xpand
• Distributed SQL
315
MariaDB Platform
Any workload. Any scale.
MariaDB Platform is the complete enterprise open source database solution. It has the versatility to
support transactional, analytical and hybrid workloads as well as relational, JSON and hybrid data
models. And it has the scalability to grow from standalone databases and data warehouses to fully
distributed SQL for executing millions of transactions per second and performing interactive, ad hoc
analytics on billions of rows.
316
MariaDB Platform
317
MariaDB Platform
318
MariaDB Platform
Q&A
Next Opensource Cloud Value
MySQL
High Availability
321
MySQL Architecture
 Replication
 Galera Cluster
 MHA
 MaxScale
 ProxySQL
322
MySQL Architecture
 Replication
– Async
 binary log
 relay log
– Semi-Sync
 Plugin
 Built-In (MariaDB 10.3)
– STANDARD, RING, STAR, MULTI-SOURCE
Binary
log
Relay
log
I/O thread
SQL thread
Primary Replica
Data changes
Read
Write
Read
Replay
Binary log
dump thread
Write
323
MySQL Architecture
 Replication
– GTID
– multi-source
– log_slave_updates
replication
Multi-source replication
Read/Write Split
auto failover
Web / WAS
L4 L4
324
MySQL Architecture
 Galera Cluster
– SYNC + Multi-Master
– 노드 장애 대응 (single point of failure, SPOF)
– Only Linux
– Only InnoDB
– wsrep API
– IST / SST
– 제약사항
 명시적 잠금 주의
 PK 필수
 XA 미지원
325
MySQL Architecture
 Galera Cluster
– Routing Layer 필요
– Row Level 병렬복제
– 3 Nodes 이상
– SST
 rsync
 xtrabackup
 mariabackup
326
MySQL Architecture
 MHA (Master High Availability)
– mha4mysql-manager
Master High Availability Manager and tools for MySQL (MHA) for automating master failover and fast
master switch. This package contains manager scripts
https://github.com/yoshinorim/mha4mysql-manager
MHA Zone
Replication Zone
Replica
Primary
MHA
Manager
Primary 감지
MHA Zone
WAS1 WAS2
Replication Zone
New
Primary
Primary
MHA
Manager
WAS1 WAS2
장애
VIP VIP
327
MySQL Architecture
 MaxScale
– BSL, GPL v2
– 다양한 기능 지원
 Proxy
 Query Routing
 Replication Monitoring
 Database Sharding
 HA
https://mariadb.com/kb/en/maxscale/
328
MySQL Architecture
 MaxScale
– SPOF 없는 고가용성 지원
– Ensure database uptime
 자동 Fail-Over
 Primary가 Fail 상태일 때도 Read Transaction 지원
– Minimize database downtime
 사용자 영향 없이 DB upgrade 지원
 Tee-filter 통해 쿼리 복제하여 신규DB로 전송
Primary
script
primary_down event
Failover Script
CHANGE MASTER to new Primary;
START Replica
Replicas
STOP Replica
Promote as Primary
binlog cache
1 4
3
2
4
329
MySQL Architecture
 ProxySQL
– Query Caching
 MySQL Query Cache 대비 3배 향상
– Query Routing
 RegEX 적용한 R/W 분할
– SQL firewall
– Supports Failover
https://proxysql.com/
Next Opensource Cloud Value
MySQL
Troubleshooting
331
MySQL Error
 장애 대응 사례
장애 사례 원인 파악 문제 해결
DB session 증가로 인한
query 지연 이슈
connection이 늘어남에 따른 query 실행 지연
현상 발생
- WAS에서 DB 서비스에 connect을 끊어 주지 않아서 발생된 이슈
로 확인
File system
data size 증가에 따른 disk full 이슈로 DB 서
비스 중지 발생
- data size가 큰 table을 partitioning 처리하여 backup후
truncate 하는 구조로 로직 변경
Memory 부족
memory 부족으로 인한 DB 서비스 중지 발생
(DBMS)
- my.cnf 설정의 memory 옵션 조정으로 서버 사양에 맞게 조정하
여 DB 서비스 복구
Schema 관리 user 실수로 table schema 문제 발생
- 개발자가 기존 table schema를 재 생성 하면서 컬럼 누락으로
이슈 발생, 확인 후 table 재 생성
DB 서비스중지 DB 서버 재부팅으로 인한 서비스 중단 발생 - VM의 OS 오류로 인한 서버 재 부팅 발생으로 VM 이슈 확인
CPU 사용률 증가 OS CPU 사용률 증가로 인한 DB query 지연 발생
- 개발 서비스 SQL문제로 인하여 개발 소스 수정 후 조치 완료
- 실행계획 확인 후 인덱스 추가조치 완료
332
MySQL Error
 MySQL Error
– Error Messages 확인
– Error log 확인
– MySQL
https://dev.mysql.com/doc/mysql-errors/8.0/en/error-reference-introduction.html
- MariaDB
https://mariadb.com/kb/en/mariadb-error-codes/
https://mariadb.com/kb/en/operating-system-error-codes/
333
MySQL InnoDB Recovery
 InnoDB Recovery
– Crash된 응급상황에서는 innodb_force_recovery 서버변수 설정
0 : 기본값, 정상상황
1 : 누락된 데이터, 손상된 페이지 감지 무시
2 : Undo 로그 삭제 무시
3 : roll-forward 수행 오류 무시
4 : Insert Buffer 손상 무시
5 : Undo 로그 무시하고 강제 COMMIT
6 : roll-forward 무시, Redo 손상에 대한 강제복구
– 0 ~ 6의 순서로 데이터베이스기동 (실패하면 다음 값으로 데이터베이스 시작)
– 데이터베이스 시작이 성공 하면 mysqldump로 백업 / 복원
334
MySQL Online DDL
 Online DDL
– COPY
– INPLACE
– NOCOPY
– INSTANT
https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl.html
https://mariadb.com/kb/en/innodb-online-ddl-overview/
335
MySQL Online DDL
Operation Instant In Place Rebuilds Table
Permits
Concurrent DML
Only Modifies
Metadata
Adding a column Yes Yes No Yes No
Dropping a column No Yes Yes Yes No
Renaming a column No Yes No Yes Yes
Reordering columns No Yes Yes Yes No
Setting a column default value Yes Yes No Yes Yes
Changing the column data type No No Yes No No
Extending VARCHAR column size No Yes No Yes Yes
Dropping the column default value Yes Yes No Yes Yes
Changing the auto-increment value No Yes No Yes No
Making a column NULL No Yes Yes Yes No
Making a column NOT NULL No Yes Yes Yes No
Modifying the definition of an ENUM or SET column Yes Yes No Yes Yes
 Online DDL Support for Column Operations
336
MySQL mysql_upgrade
 mysql_upgrade
감사합니다
338
Next Opensource Cloud Value
Bonus
340
MariaDB Migration
341
MariaDB MaxScale
 MaxScale BSL (Business Source License)
BSL은 Closed Source 또는 Open Core 라이선스 모델의 새로운 대안입니다. BSL에서 소스 코드는 항상 자유롭게 사용할 수 있으며 특정
시점 (즉, 변경 날짜)에 오픈 소스가 될 수 있습니다. BSL의 특정 수준 이하의 사용은 항상 완전 무료입니다. 지정된 수준 (고급 사용자)
이상으로 사용하면 변경 날짜까지 공급 업체 라이선스가 필요하며 이 시점에서 모든 사용은 무료가 됩니다.
(참고 https://mariadb.com/bsl-faq-mariadb )
Additional Use Grant: You may use the Licensed Work when your application uses the Licensed Work with a total of less than
three server instances for any purpose.
Version First Release Latest version Latest release
MaxScale 2.2 2017-10-12 2.2.21 2019-05-08
MaxScale 2.3 2018-10-09 2.3.20 2020-06-05
MaxScale 2.4 2019-06-29 2.4.17 2021-03-08
MaxScale 2.5 2020-06-18 2.5.13 2021-06-04
Version BSL change date
MaxScale 2.2.21 2020-01-01
MaxScale 2.3.12 2022-01-01
MaxScale 2.3.13 2023-10-29
MaxScale 2.3.20 2024-06-02
MaxScale 2.4.6 2024-01-15
MaxScale 2.4.13 2024-10-14
MaxScale 2.5.5 2024-10-14
MaxScale 2.5.11 2025-04-28
342
Docker container
 MySQL docker
https://hub.docker.com/_/mysql
343
K8S Operator
 Percona Kubernetes Operators
https://www.percona.com/software/percona-kubernetes-operators
The Percona Kubernetes Operators automate the creation, alteration, or deletion of members in your
Percona Distribution for MySQL, MongoDB, or PostgreSQL environment. It can be used to instantiate a
new environment, or to scale an existing environment. The Operator contains all necessary
Kubernetes settings to provide a proper and consistent Percona XtraDB Cluster, Percona Server for
MongoDB, or Percona Distribution for PostgreSQL instance.
Kubernetes Operators provide a way to package, deploy, and manage a Kubernetes application. A
Kubernetes application is deployed on Kubernetes and managed using the Kubernetes APIs and tooling.
Operators help in building cloud-native applications by delivering automation advantages like
deploying, scaling, and backup and restore while being able to run anywhere Kubernetes is deployed.
Next Opensource Cloud Value
NeoClova
345
NeoClova
회사명
임직원
대표이사
설립년도
주소
대표전화
홈페이지
주식회사 네오클로바
19명
이 재 중
2011년 11월
서울시 강서구 양천로 583, 우림블루나인 B동 12층
02-539-4880
www.neoclova.co.kr
기업 개요 주요 파트너쉽
주요사업분야
IT 통합유지보수
Red Hat Enterprise Linux, JBoss, Apache / Tomcat,
MySQL / MariaDB / Percona Technical Support
Red Hat Ready Partner
T2 Partner
Registered Partner
Registered Partner
Registered Partner
346
NeoClova reference
주요 고객사
구축 부분
오픈소스
구축
업무분석
운영지원
컨설팅
- 운영시스템 전반 유지보수
- 장애 및 성능 분석 지원
- U.Key 3.0 U2L PI
- Unix Oracle RAC to Linux구축
- Jboss EWS/EAP 전환 및 성능 측정
- MySQL/MariaDB 컨설팅 서비스
- 통합시스템 내 리눅스 부분
유지보수 및 분석 지원
- 정보시스템 클라우드 전환 컨설팅 (ISP)
- 전체운영시스템 클라우드 전환 ISP
- G-Box플랫폼 구축 관련 오픈소스 지원
- ITO 오픈소스 컴플라이언스 검증
- New Kt.com 구축 관련 오픈소스 지원
- 오픈소스 SW 전사기술지원
- 가족관계 등록정보시스템 구축 사업내 오픈소스 구축
- 온라인 출생신고시스템 전산장비 도입 사업내
오픈소스 구축
- 스마트 산업입지 플랫폼 시범사업 전산장비 구축내 오픈소스 부분
- 빅데이터 기반의 차세대 공장설립온라인지원시스템 구축내 오픈소스 부분
- 차세대 운영정보시스템 구축내 오픈소스 부분
- 운영시스템 오픈소스(Linux부분) 운영지원
- 운영시스템 통합유지보수 지원
347
NeoClova
지원제품 List
1.3 Amazon Web Services
2.1 Red Hat OpenStack Platform
3.1 MySQL
4.1 Red Hat JBoss EAP
2.4 Red Hat Gluster Storage
5.1 Red Hat Enterprise Linux
1.1 Google Cloud Platform
2.2 Red Hat OpenShift Container Platform
2.3 Red Hat Ceph Storage 2.6 Azure Stack
2.5 Red Hat Virtualization
3.2 MariaDB
4.2 Red Hat JBoss Web Server
1.2 Microsoft Azure
4.3 Red Hat OpenShift
4.4 ACCORDION
4.5 Apache / Tomcat / NginX
5.2 CentOS
5.3 Ubuntu
5.4 Oracle Linux
3.4 DBMON-Star(DB 모니터링 자체솔루션)
3.5 DB CHECKER(DataBase 검증 및 자체튜닝 솔루션)
3.3 Percona Server for MySQL

Mais conteúdo relacionado

Mais procurados

Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼NeoClova
 
MariaDB 제품 소개
MariaDB 제품 소개MariaDB 제품 소개
MariaDB 제품 소개NeoClova
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Mydbops
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Mydbops
 
Maxscale 소개 1.1.1
Maxscale 소개 1.1.1Maxscale 소개 1.1.1
Maxscale 소개 1.1.1NeoClova
 
How to set up orchestrator to manage thousands of MySQL servers
How to set up orchestrator to manage thousands of MySQL serversHow to set up orchestrator to manage thousands of MySQL servers
How to set up orchestrator to manage thousands of MySQL serversSimon J Mudd
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBMydbops
 
ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)Mydbops
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기NHN FORWARD
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance OptimisationMydbops
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScaleMariaDB plc
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability Mydbops
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
 
An Overview to MySQL SYS Schema
An Overview to MySQL SYS Schema An Overview to MySQL SYS Schema
An Overview to MySQL SYS Schema Mydbops
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQLI Goo Lee
 
Percona server for MySQL 제품 소개
Percona server for MySQL 제품 소개Percona server for MySQL 제품 소개
Percona server for MySQL 제품 소개NeoClova
 
MySQL Performance Schema in Action
MySQL Performance Schema in ActionMySQL Performance Schema in Action
MySQL Performance Schema in ActionSveta Smirnova
 
MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !Frederic Descamps
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLRené Cannaò
 

Mais procurados (20)

Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
MariaDB 제품 소개
MariaDB 제품 소개MariaDB 제품 소개
MariaDB 제품 소개
 
Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0Redo log improvements MYSQL 8.0
Redo log improvements MYSQL 8.0
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
 
Maxscale 소개 1.1.1
Maxscale 소개 1.1.1Maxscale 소개 1.1.1
Maxscale 소개 1.1.1
 
How to set up orchestrator to manage thousands of MySQL servers
How to set up orchestrator to manage thousands of MySQL serversHow to set up orchestrator to manage thousands of MySQL servers
How to set up orchestrator to manage thousands of MySQL servers
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 
InnoDB Performance Optimisation
InnoDB Performance OptimisationInnoDB Performance Optimisation
InnoDB Performance Optimisation
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
MySQL 5.5 Guide to InnoDB Status
MySQL 5.5 Guide to InnoDB StatusMySQL 5.5 Guide to InnoDB Status
MySQL 5.5 Guide to InnoDB Status
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
 
An Overview to MySQL SYS Schema
An Overview to MySQL SYS Schema An Overview to MySQL SYS Schema
An Overview to MySQL SYS Schema
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
 
Percona server for MySQL 제품 소개
Percona server for MySQL 제품 소개Percona server for MySQL 제품 소개
Percona server for MySQL 제품 소개
 
MySQL Performance Schema in Action
MySQL Performance Schema in ActionMySQL Performance Schema in Action
MySQL Performance Schema in Action
 
MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !MySQL Shell - the best DBA tool !
MySQL Shell - the best DBA tool !
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 

Semelhante a MySQL Advanced Administrator 2021 - 네오클로바

Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsNelson Calero
 
Upgrade to MySQL 5.7 and latest news planned for MySQL 8
Upgrade to MySQL 5.7 and latest news planned for MySQL 8Upgrade to MySQL 5.7 and latest news planned for MySQL 8
Upgrade to MySQL 5.7 and latest news planned for MySQL 8Ted Wennmark
 
Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)kayokogoto
 
SQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
SQL Server 2014 Extreme Transaction Processing (Hekaton) - BasicsSQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
SQL Server 2014 Extreme Transaction Processing (Hekaton) - BasicsTony Rogerson
 
MySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats newMySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats newMark Swarbrick
 
MySQL 5.7 New Features for Developers
MySQL 5.7 New Features for DevelopersMySQL 5.7 New Features for Developers
MySQL 5.7 New Features for DevelopersZohar Elkayam
 
MySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellMySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellEmily Ikuta
 
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013Jaime Crespo
 
MySQL Data Encryption at Rest
MySQL Data Encryption at RestMySQL Data Encryption at Rest
MySQL Data Encryption at RestMydbops
 
MySQL Manchester TT - 5.7 Whats new
MySQL Manchester TT - 5.7 Whats newMySQL Manchester TT - 5.7 Whats new
MySQL Manchester TT - 5.7 Whats newMark Swarbrick
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 Geir Høydalsvik
 
MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015Mario Beck
 
MariaDB with SphinxSE
MariaDB with SphinxSEMariaDB with SphinxSE
MariaDB with SphinxSEColin Charles
 
MySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document StoreMySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document StoreAbel Flórez
 
Query Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New TricksQuery Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New TricksMYXPLAIN
 

Semelhante a MySQL Advanced Administrator 2021 - 네오클로바 (20)

MySQL database
MySQL databaseMySQL database
MySQL database
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAs
 
Upgrade to MySQL 5.7 and latest news planned for MySQL 8
Upgrade to MySQL 5.7 and latest news planned for MySQL 8Upgrade to MySQL 5.7 and latest news planned for MySQL 8
Upgrade to MySQL 5.7 and latest news planned for MySQL 8
 
Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)
 
SQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
SQL Server 2014 Extreme Transaction Processing (Hekaton) - BasicsSQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
SQL Server 2014 Extreme Transaction Processing (Hekaton) - Basics
 
MySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats newMySQL Tech Tour 2015 - 5.7 Whats new
MySQL Tech Tour 2015 - 5.7 Whats new
 
MySQL 5.7 New Features for Developers
MySQL 5.7 New Features for DevelopersMySQL 5.7 New Features for Developers
MySQL 5.7 New Features for Developers
 
MySQL 5.7 in a Nutshell
MySQL 5.7 in a NutshellMySQL 5.7 in a Nutshell
MySQL 5.7 in a Nutshell
 
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
Query Optimization with MySQL 5.6: Old and New Tricks - Percona Live London 2013
 
MySQL Data Encryption at Rest
MySQL Data Encryption at RestMySQL Data Encryption at Rest
MySQL Data Encryption at Rest
 
MySQL Manchester TT - 5.7 Whats new
MySQL Manchester TT - 5.7 Whats newMySQL Manchester TT - 5.7 Whats new
MySQL Manchester TT - 5.7 Whats new
 
Database storage engines
Database storage enginesDatabase storage engines
Database storage engines
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015 2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
 
MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015
 
Oracle DBA
Oracle DBAOracle DBA
Oracle DBA
 
MySQL 5.7 what's new
MySQL 5.7 what's newMySQL 5.7 what's new
MySQL 5.7 what's new
 
MariaDB with SphinxSE
MariaDB with SphinxSEMariaDB with SphinxSE
MariaDB with SphinxSE
 
Fudcon talk.ppt
Fudcon talk.pptFudcon talk.ppt
Fudcon talk.ppt
 
MySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document StoreMySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document Store
 
Query Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New TricksQuery Optimization with MySQL 5.6: Old and New Tricks
Query Optimization with MySQL 5.6: Old and New Tricks
 

Mais de NeoClova

MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11NeoClova
 
MySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptxMySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptxNeoClova
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxNeoClova
 
MariaDB10.7_install_Ubuntu.docx
MariaDB10.7_install_Ubuntu.docxMariaDB10.7_install_Ubuntu.docx
MariaDB10.7_install_Ubuntu.docxNeoClova
 
MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)NeoClova
 
redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바NeoClova
 

Mais de NeoClova (6)

MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11MaxScale이해와활용-2023.11
MaxScale이해와활용-2023.11
 
MySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptxMySQL_MariaDB로의_전환_기술요소-202212.pptx
MySQL_MariaDB로의_전환_기술요소-202212.pptx
 
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docxKeepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
Keepalived+MaxScale+MariaDB_운영매뉴얼_1.0.docx
 
MariaDB10.7_install_Ubuntu.docx
MariaDB10.7_install_Ubuntu.docxMariaDB10.7_install_Ubuntu.docx
MariaDB10.7_install_Ubuntu.docx
 
MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)MariaDB 10.5 binary install (바이너리 설치)
MariaDB 10.5 binary install (바이너리 설치)
 
redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바redis 소개자료 - 네오클로바
redis 소개자료 - 네오클로바
 

Último

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Último (20)

Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

MySQL Advanced Administrator 2021 - 네오클로바

  • 2. Next Opensource Cloud Value MySQL Optimization
  • 3. 241 MySQL Optimization • Hardware – CPU  single processing  빠른 Processor ( Fast Clock Speed)  bus speed, cache size  More Cores – Memory  슬롯당 최대 RAM Size 우선선택 – Disk  빠른 Disk speed  redo / undo / binary log 전용 디스크
  • 4. 242 MySQL Optimization • Linux – IO scheduler – Open files / core file size – Swappiness
  • 6. 244 MySQL Optimization • SQL 튜닝 – SQL 수행을 위한 실행계획 확인 – 최적의 실행계획을 위한 적절한 INDEX 확인 – PRIMARY KEY & SECONDARY KEY – JOIN – EXPLAIN
  • 7. 245 MySQL Optimization • Primary Key – PK 없으면 6bytes 더미 PK 컬럼 생성 – secondary key lookup – sql_require_primary_key 설정 http://philipzhong.blogspot.com/2011/06/how-to-improve-mysql-select-count.html
  • 8. 246 MySQL Optimization • Secondary Key – leaf node에 PK 포함 – key lookup 통해서 PK 데이터를 검색 – Covered Index https://www.slideshare.net/mysqlops/innodb-internal-9032556
  • 9. 247 MySQL Optimization • JOIN – 모든 SQL Single processing – 오직 Nested Loop Join – 조인 컬럼을 가지고 Driving Table에서 Driven Table 접근 https://mariadb.com/kb/en/semi-join-materialization-strategy/
  • 10. 248 MySQL Optimization • EXPLAIN – slow query 확인 – 옵티마이저의 변환 – 적절한 조인 순서 – 인덱스 확인 – SQL 수정 판단 컬럼 설명 id 한 테이블의 SELECT 번호, 쿼리내의 SELECT의 구분번호 select_type SELECT의 타입(SIMPLE, PRIMARY, UNION, SUBQUERY, DRIVED, …) table 해당 table명 type 조인의 타입(system, const, eq_ref, ref, ref_or_null, …) passible_keys 테이블의 사용 가능한 인덱스들 명 key Passible_keys 값들 중에서 실제 사용한 인덱스(key) Key_len Where절에 사용한 인덱스의 길이(byte) ref 행을 추출하는데 key와 함께 사용한 컬럼 이나 상수 rows 쿼리수행을 위해 검사대상 예상행수 filtered 조건절에 의해 필터링 되는 행의 비율 extra 쿼리를 해석한 추가적인 정보
  • 11. 249 MySQL Optimization • Query Analysis – Use EXPLAIN to see how MariaDB Executes a Troublesome Query and if Indexes are Used – Use EXPLAIN EXTENDED and SHOW WARNINGS to see how MariaDB Rearranges a Query before Execution
  • 12. 250 MySQL Optimization • select_type – SIMPLE : UNION 이나 SUBQUERY를 사용하지 않는 단순 SELECT – PRIMARY : 쿼리 제일 바깥쪽에 있는 SELECT – DERIVED : SELECT절로 추출된 테이블로 FROM절 내부의 SUBQUERY의미 – UNION : UNION절에서 두번째 이후 SELECT, 첫번째는 DRIVED – DEPENDENT UNION : 내부 쿼리가 외부 값을 참조하는 UNION절 테이블 – UNION RESULT : UNION 결과 값에 대한 임시 테이블 – SUBQUERY : FROM절 이외의 서브 쿼리 의미 – DEPENDENT SUBQUERY : 서브쿼리가 바깥쪽 SELECT절의 컬럼 값을 참조 – UNCHACHEABLE SUBQUERY : 서브쿼리 결과가 외부 쿼리의 변하는 값에 따라 매번 새로 생성 – UNCHACHEABLE UNION : 캐싱이 불가능한 요소를 포함한 UNION
  • 13. 251 MySQL Optimization • Scan or Index Method types – const : A constant value can be read once and cached – eq_ref : One index access per outer query row – ref : Multiple index accesses per outer query row – index_merge : Multiple indexes used, merging into a single result set – range : Multiple index accesses to return all rows within a range – index : Full index scan (every index entry is read sequentially) – all : Full table scan (every record is read sequentially)
  • 14. 252 MySQL Optimization • Analyze Columns – Analyze Columns with PROCEDURE ANALYSE() – Use PROCEDURE ANALYSE() for Data Type Recommendations
  • 15. 253 MySQL Optimization • Indexes for Performance Optimization – MariaDB can Resolve Queries Faster with Indexes Faster Retrieval of Matching Rows, Faster Sorting of Result Sets Without Indexes, MariaDB does Full Table Scan – Indexes can be for a Column or Multiple Columns (i.e.,Composites) – Index for Speed, but Avoid Indexing Excessively or Arbitrarily – Remove Unused or Redundant Indexes
  • 16. 254 MySQL Optimization • Create Table Indexes – Use ALTER TABLE or CREATE INDEX to add an Index – Keep Indexes as Small as Practical – For Indexing Strings, Use Prefix
  • 17. 255 MySQL Optimization • Better JOIN Construction – Foreign Keys used with Joins should be Indexed – Index Columns in ON and USING Clauses – Keep GROUP BY and ORDER BY columns in one Table for better Indexing
  • 18. 256 MySQL Optimization • InnoDB 제약 조건 – InnoDB tables can have a maximum of 1,017 columns – The maximum size for BLOB and TEXT columns is 4GB. This also applies to LONGBLOB and LONGTEXT – MariaDB imposes a row-size limit of 65,535 bytes for the combined sizes of all columns – The innodb_large_prefix system variable enables large prefix sizes That is, when enabled InnoDB uses 3072B index key prefixes for DYNAMIC and COMPRESSED row formats When disabled, it uses 787B key prefixes for tables of any row format
  • 19. Next Opensource Cloud Value MySQL information_schema
  • 20. 258 MySQL information_schema • 메타데이터를 저장하는 데이터베이스/스키마 – 읽기 전용, 버전 별로 테이블 수가 다름 • 가상 데이터베이스 – Datadir에 폴더가 없음 • metadata 정보를 얻기 위해 SELECT사용
  • 21. 259 MySQL information_schema  Tables in information_schema 설명 CHARACTER_SETS 사용 가능한 캐릭터 셋 COLLATIONS 각각의 캐릭터 셋을 위한 콜래이션 COLUMNS 테이블 안에 컬럼 COLUMN_PRIVILEGES 컬럼 권한은 사용자 계정에 의해서 따름 ENGINES 스토리지 엔진 EVENTS 스케줄된 이벤트 KEY_COLUMN_USAGE 키 컬럼 제한 PARTITIONS 테이블 파티션 PLUGINS 서버 플러그인
  • 22. 260 MySQL information_schema  Tables in information_schema 설명 PROCESSLIST 실행중인 스레드 확인 하기 REFERENTIAL_CONSTRAINTS foreign keys ROUTINES 저장 프로시저와 함수 SCHEMATA 데이터베이스 SCHEMA_PRIVILEGES 데이터베이스 권한은 사용자 계정에 따름 STATISTICS 테이블 통계 TABLES 데이터베이스 안에 테이블 TABLE_CONSTRAINTS 테이블 제약 TABLE_PRIVILEGES 테이블 권한은 사용자 계정에 따름
  • 23. 261 MySQL information_schema  Tables in information_schema 설명 TRIGGERS 트리거 USER_PRIVILEGES 전역 권한은 사용자 권한에 따름 VIEWS 뷰 INNODB_LOCKS 트랜잭션의 잠금 요청에 대한 대기정보 및 차단하는 정보 INNODB_LOCK_WAITS 트랜잭션 차단된 대기정보 INNODB_TRX 실행중인 트랜잭션 정보 TokuDB_file_map TokuDB 디렉토리명 및 테이블, 인덱스 파일명
  • 24. 262 MySQL information_schema • 데이터베이스별 엔진 • 시스템 변수 확인
  • 25. 263 MySQL information_schema • Foreign key 확인 • InnoDB lock 확인
  • 26. 264 MySQL information_schema • 데이터베이스 사용량 • 테이블 사용량
  • 27. 265 MySQL information_schema • Primary key 확인 https://www.vertabelo.com/blog/querying-mysqls-information-schema-why-how/
  • 29. 267 MySQL information_schema • Index 사용량 http://code.openark.org/blog/mysql/useful-database-analysis-queries-with-information_schema
  • 32. 270 MySQL information_schema  SHOW 명령 – SHOW DATABASES – SHOW [FULL] TABLES – SHOW [FULL] COLUMNS – SHOW INDEX – SHOW CHARACTER SET – SHOW COLLATION – SHOW Engines – SHOW Plugins
  • 33. Next Opensource Cloud Value MySQL performance_schema
  • 34. 272 MySQL performance_schema The MySQL Performance Schema is a feature for monitoring MySQL Server execution at a low level my.cnf performance_schema = ON 인스턴스의 모니터링 - 내부 실행중에 발생하는 이벤트를 검사, 모니터링 - 동적으로 수정 가능 - 메모리 내 저장, 종료 시 삭제 주요 특징 - 복제 대상 아님 - 활성화 시 수집 지표에 따라 5~15% 성능저하 - 구문분석, 실행계획 등에 영향 없음
  • 35. 273 MySQL performance_schema • setup_consumers 설정 - 모니터링 하고자 하는 계측테이블을 활성화 • setup_instruments 설정 - 모니터링 하고자 하는 계측기 활성화
  • 36. 274 MySQL performance_schema • user, host, accounts 확인 • 실행 쿼리 확인
  • 37. 275 MySQL performance_schema • 실행 thread 확인 • IO wait 많은 테이블 확인 - sum_timer_wait 등 time 정보는 picoseconds (1 * 10 ^ 12)
  • 38. 276 MySQL performance_schema • 수행 시간이 오래 걸린 SQL • 파일별 IO wait
  • 39. Next Opensource Cloud Value MySQL sys schema
  • 40. 278 MySQL sys schema MySQL 8.0 includes the sys schema, a set of objects that helps DBAs and developers interpret data collected by the Performance Schema. sys schema objects can be used for typical tuning and diagnosis use cases. Objects in this schema include: • Views that summarize Performance Schema data into more easily understandable form • Stored procedures that perform operations such as Performance Schema configuration and generating diagnostic reports • Stored functions that query Performance Schema configuration and provide formatting services https://dev.mysql.com/doc/refman/8.0/en/sys-schema.html
  • 41. 279 MySQL sys schema 설명 sys_config sys schema configuration options table host_summary Statement activity, file I/O, and connections, grouped by host host_summary_by_file_io File I/O, grouped by host host_summary_by_file_io_type File I/O, grouped by host and event type host_summary_by_stages Statement stages, grouped by host host_summary_by_statement_latency Statement statistics, grouped by host host_summary_by_statement_type Statements executed, grouped by host and statement innodb_buffer_stats_by_schema InnoDB buffer information, grouped by schema innodb_buffer_stats_by_table InnoDB buffer information, grouped by schema and table innodb_lock_waits InnoDB lock information
  • 42. 280 MySQL sys schema 설명 io_by_thread_by_latency I/O consumers, grouped by thread io_global_by_file_by_bytes Global I/O consumers, grouped by file and bytes io_global_by_file_by_latency Global I/O consumers, grouped by file and latency io_global_by_wait_by_bytes Global I/O consumers, grouped by bytes io_global_by_wait_by_latency Global I/O consumers, grouped by latency latest_file_io Most recent I/O, grouped by file and thread memory_by_host_by_current_bytes Memory use, grouped by host memory_by_thread_by_current_bytes Memory use, grouped by thread memory_by_user_by_current_bytes Memory use, grouped by user memory_global_by_current_bytes Memory use, grouped by allocation type
  • 43. 281 MySQL sys schema 설명 memory_global_total Total memory use metrics Server metrics processlist Processlist information ps_check_lost_instrumentation Variables that have lost instruments schema_auto_increment_columns AUTO_INCREMENT column information schema_index_statistics Index statistics schema_object_overview Types of objects within each schema schema_redundant_indexes Duplicate or redundant indexes schema_table_lock_waits Sessions waiting for metadata locks schema_table_statistics Table statistics
  • 44. 282 MySQL sys schema 설명 schema_table_statistics_with_buffer Table statistics, including InnoDB buffer pool statistics schema_tables_with_full_table_scans Tables being accessed with full scans schema_unused_indexes Indexes not in active use session Processlist information for user sessions session_ssl_status Connection SSL information statement_analysis Statement aggregate statistics statements_with_errors_or_warnings Statements that have produced errors or warnings statements_with_full_table_scans Statements that have done full table scans statements_with_runtimes_in_95th_percent ile Statements with highest average runtime statements_with_sorting Statements that performed sorts
  • 45. 283 MySQL sys schema 설명 statements_with_temp_tables Statements that used temporary tables user_summary User statement and connection activity user_summary_by_file_io File I/O, grouped by user user_summary_by_file_io_type File I/O, grouped by user and event user_summary_by_stages Stage events, grouped by user user_summary_by_statement_latency Statement statistics, grouped by user user_summary_by_statement_type Statements executed, grouped by user and statement wait_classes_global_by_avg_latency Wait class average latency, grouped by event class wait_classes_global_by_latency Wait class total latency, grouped by event class waits_by_host_by_latency Wait events, grouped by host and event
  • 46. 284 MySQL sys schema 설명 waits_by_user_by_latency Wait events, grouped by user and event waits_global_by_latency Wait events, grouped by event x$ps_digest_95th_percentile_by_avg_us Helper view for 95th-percentile views x$ps_digest_avg_latency_distribution Helper view for 95th-percentile views x$ps_schema_table_statistics_io Helper view for table-statistics views x$schema_flattened_keys Helper view for schema_redundant_indexes
  • 47. Q&A
  • 48. Next Opensource Cloud Value Percona
  • 49. 287 Percona Percona Server for MySQL • All Percona Software is 100% Free and Open Source • No Restricted “Enterprise” version • MySQL과 기본적으로 구조 및 사용 방법 동일 • GPL v2 License • Oracle로부터 자유로울 수 있음 https://percona.com/
  • 50. 288 Percona Percona Server for MySQL https://www.percona.com/blog/2016/03/17/percona-server-5-7-performance-improvements/
  • 51. 289 Percona Percona Server for MySQL Percona XtraDB Cluster Percona XtraBackup Percona Server for MongoDB Percona Backup for MongoDB Percona Distribution for PostgreSQL Percona Monitoring and Management Percona Kubernetes Operators Percona Toolkit
  • 52. Next Opensource Cloud Value MariaDB
  • 56. 294 MariaDB Foundation The MariaDB Foundation The MariaDB Foundation supports continuity and open collaboration in the MariaDB ecosystem. The Foundation guarantees that there is a global contact point for collaboration and that the community can always rely upon MariaDB Server. https://mariadb.org/
  • 57. 295 MariaDB Sea Lion The Story of our Sea Lion https://mariadb.org/sea-lion/ Our Founder Monty likes animals in the sea. For MySQL, he picked a dolphin, after swimming with them in the Florida Keys. For the MariaDB sea lion, there was a similar encounter. It happened when Monty and his older daughter My were snorkeling on one of the islands in the Galapagos. Something big, brown and fast suddenly appeared at an arm’s distance, laughing in their faces. Fond memories of this fast and funny creature, scaring the tourists, popped into Monty’s mind when asked picking a logo for MariaDB. He wanted to adhere to the tradition of animals as symbols of Open Source projects.
  • 58. 296 MariaDB OpenSource THE VALUE OF OPEN SOURCE http://www.regist-event.com/event/2019/mariadb0925/200.%20open-source- user%2020190925%20(Michael%20Monty%20Widenius).pdf MySQL-MariaDB History talk https://mariadb.org/wp-content/uploads/2019/11/MySQL-MariaDB-story.pdf
  • 59. 297 MariaDB OpenSource Why MariaDB was created “Save the People, Save the Product” - To keep the MySQL talent together - To ensure that a free version of MySQL always exists - To get one community developed and maintained branch - Work with other MySQL forks/branches to share knowhow and code After Oracle announced it wanting to buy Sun & MySQL this got to be even more important.
  • 60. 298 MariaDB OpenSource 11 Reasons Open Source is Better than Closed Source - Using open standards (no lock in into proprietary standards) - Resource friendly; OSS software tend to work on old hardware - Lower cost; Usually 1/10 of closed source software - No cost for testing the full software - Better documentation and more troubleshooting resources - Better support, in many cases directly from the developers - Better security, auditability (no trap doors and more eye balls) - Better quality; Developed together with users - Better customizability; You can also participate in development - No vendor lock in; More than one vendor can give support - When using open source, you take charge of your own future
  • 61. 299 MariaDB OpenSource MariaDB is guaranteed to always be open source - The MariaDB Foundation was created to ensure that anyone can be a contributor to the MariaDB project on equal terms! - The MariaDB Foundation is the owner of the main MariaDB server repositories on github - The Foundation can never to be controlled by a single entity or person - The Foundation is not about the MariaDB trademark or to decide upon the MariaDB roadmap!
  • 62. 300 MariaDB OpenSource BUSINESS SOURCE LICENSE (DELAYED OPEN SOURCE) - Not an Open Source license, but gives the users similar advantages as Open Source. - Source code is available from the start. Anyone has the right to copy, modify & distribute but can't use it commercially under some conditions you define. - After X years the code automatically converts to some Open Source / Free license. The date has to be explicitly set in all source code files to avoid misunderstandings. - Better than Open Core as this removes the “one vendor” problem and the code will eventually be free. - Investor friendly (as there is a way to force some users to pay).
  • 63. 301 MariaDB compatibility Oracle compatibility - MariaDB ups the stakes in database war with Oracle - http://www.channelworld.in/news/mariadb-ups-stakes-database-war-oracle - Michael Howard, who worked at Oracle for four years between 1996-2000, has been CEO of MariaDB since December 2015. - "Isn't it ironic that Oracle Enterprise, MySQL's bigger brother, provides data warehousing yet it is MariaDB that is delivering it to you, this community? They don't want you to succeed with MySQL, they certainly don't want MySQL to cannibalise things like Exadata."
  • 64. 302 MariaDB Storage Engine  Aria • Aria is a crash safe MyISAM + more • This should speed up some GROUP BY and DISTINCT queries because Aria has better caching than MyISAM  FederatedX • Transactions (beta feature) • Supports partitions (alpha feature)
  • 65. 303 MariaDB Storage Engine - ColumnStore • GPLv2 라이센스 • Columnar, Massively Parallel MariaDB Storage Engine • 확장 가능한 고성능 분석 플랫폼 • Runs On premise, On AWS/Azure cloud or Hadoop HDFS cluster • 플랫폼에 관계없이 전체 SQL구문 지원 MariaDB ColumnStore
  • 66. 304 MariaDB Storage Engine - ColumnStore • 대용량 데이터 분석 엔진 & 플랫폼 - 1TB ~ 수PB의 대용량 데이터에 대한 고성능 분석 제공 - 필요한 컬럼 들만 질의 수행 - 다수의 디멘전 테이블의 조인 - MPP 구조의 다수 노드 구성 가능 - 복잡한 SQL 조인 지원, Windowing Functions 지원
  • 67. 305 MariaDB Storage Engine - ColumnStore
  • 68. 306 MariaDB Storage Engine - ColumnStore
  • 69. 307 MariaDB Storage Engine - ColumnStore • USER MODULES - mysqld : The MariaDB server - ExeMgr : MariaDB’s interface to ColumnStore - cpimport : high-performance data import • QUERY PROCESSING - UM - SQL Operations are translated into thousands of Primitives - Parallel/Distributed SQL - Extensible with Parallel/Distributed UDFs - Query is parsed by mysqld on UM node - Parsed query handed over to ExeMgr on UM node - ExeMgr breaks down the query in primitive operations
  • 70. 308 MariaDB Storage Engine - ColumnStore • PERFORMANCE MODULES - PrimProc : Primitives Processor - WriteEngineServer : Database file writing processor - DMLProc : DML writes processor - DDLProc : DDL processor • QUERY PROCESSING - PM - 블록 지향 읽기 및 쓰기 처리 지원 (I/O 작업) - 분산 스캔, 분산 해시조인, 분산 집계를 통한 MPP 지원 - 공유 데이터 캐시 사용
  • 72. 310 MariaDB Storage Engine - Connect • 주요 기능 - 외부 데이터 형식(DBMS, file, datasource, virtual) 연결 - ODBC, JDBC, MySQL or MongoDB API 통해 DataSource에 직접 연결 - JSON, XML, HTML파일 및 JSON UDF통한 NOSQL 쿼리지원 - WHERE절에 대한 푸시다운 - Special & Virtual Columns 지원 - 다중테이블의 병렬실행 가능 - 서브 테이블별 파티셔닝 지원 - SELECT, UPDATE 및 DELETE에 대한 MRR 지원
  • 73. 311 MariaDB Storage Engine - Connect • PARAMETERS - connect_class_path : java class path - connect_conv_size : text유형 변환 시 varchar크기 - connect_enable_mongo : mongo table type enable - connect_exact_info : 정확한 레코드번호 리턴 여부 - connect_index_map : 인덱스 파일에 대한 파일매핑 활성화여부 - connect_java_wrapper : java wrapper - connect_json_grp_size : JSON 집계함수의 최대 행 수 - connect_json_null : JSON NULL값 - connect_jvm_path : JVM 경로 - connect_type_conv : TEXT 컬럼의 변환 처리 옵션 - connect_use_tempfile - connect_work_size : 메모리할당에 사용되는 크기 - connect_xtrace : 콘솔추적값
  • 74. 312 MariaDB Storage Engine - Xpand • Xpand (Clustrix) - Xpand provides distributed SQL - Xpand integrates with the Xpand storage engine in MariaDB Enterprise Server 10.5 - Xpand supports transactional workloads - Xpand is strongly consistent - Xpand leverages a shared-nothing architecture to efficiently execute distributed SQL - Xpand provides high availability (HA) and fault tolerance by design - Xpand scales out horizontally for both reads and writes
  • 75. 313 MariaDB Storage Engine - Xpand • Distributed SQL
  • 76. 314 MariaDB Storage Engine - Xpand • Distributed SQL
  • 77. 315 MariaDB Platform Any workload. Any scale. MariaDB Platform is the complete enterprise open source database solution. It has the versatility to support transactional, analytical and hybrid workloads as well as relational, JSON and hybrid data models. And it has the scalability to grow from standalone databases and data warehouses to fully distributed SQL for executing millions of transactions per second and performing interactive, ad hoc analytics on billions of rows.
  • 81. Q&A
  • 82. Next Opensource Cloud Value MySQL High Availability
  • 83. 321 MySQL Architecture  Replication  Galera Cluster  MHA  MaxScale  ProxySQL
  • 84. 322 MySQL Architecture  Replication – Async  binary log  relay log – Semi-Sync  Plugin  Built-In (MariaDB 10.3) – STANDARD, RING, STAR, MULTI-SOURCE Binary log Relay log I/O thread SQL thread Primary Replica Data changes Read Write Read Replay Binary log dump thread Write
  • 85. 323 MySQL Architecture  Replication – GTID – multi-source – log_slave_updates replication Multi-source replication Read/Write Split auto failover Web / WAS L4 L4
  • 86. 324 MySQL Architecture  Galera Cluster – SYNC + Multi-Master – 노드 장애 대응 (single point of failure, SPOF) – Only Linux – Only InnoDB – wsrep API – IST / SST – 제약사항  명시적 잠금 주의  PK 필수  XA 미지원
  • 87. 325 MySQL Architecture  Galera Cluster – Routing Layer 필요 – Row Level 병렬복제 – 3 Nodes 이상 – SST  rsync  xtrabackup  mariabackup
  • 88. 326 MySQL Architecture  MHA (Master High Availability) – mha4mysql-manager Master High Availability Manager and tools for MySQL (MHA) for automating master failover and fast master switch. This package contains manager scripts https://github.com/yoshinorim/mha4mysql-manager MHA Zone Replication Zone Replica Primary MHA Manager Primary 감지 MHA Zone WAS1 WAS2 Replication Zone New Primary Primary MHA Manager WAS1 WAS2 장애 VIP VIP
  • 89. 327 MySQL Architecture  MaxScale – BSL, GPL v2 – 다양한 기능 지원  Proxy  Query Routing  Replication Monitoring  Database Sharding  HA https://mariadb.com/kb/en/maxscale/
  • 90. 328 MySQL Architecture  MaxScale – SPOF 없는 고가용성 지원 – Ensure database uptime  자동 Fail-Over  Primary가 Fail 상태일 때도 Read Transaction 지원 – Minimize database downtime  사용자 영향 없이 DB upgrade 지원  Tee-filter 통해 쿼리 복제하여 신규DB로 전송 Primary script primary_down event Failover Script CHANGE MASTER to new Primary; START Replica Replicas STOP Replica Promote as Primary binlog cache 1 4 3 2 4
  • 91. 329 MySQL Architecture  ProxySQL – Query Caching  MySQL Query Cache 대비 3배 향상 – Query Routing  RegEX 적용한 R/W 분할 – SQL firewall – Supports Failover https://proxysql.com/
  • 92. Next Opensource Cloud Value MySQL Troubleshooting
  • 93. 331 MySQL Error  장애 대응 사례 장애 사례 원인 파악 문제 해결 DB session 증가로 인한 query 지연 이슈 connection이 늘어남에 따른 query 실행 지연 현상 발생 - WAS에서 DB 서비스에 connect을 끊어 주지 않아서 발생된 이슈 로 확인 File system data size 증가에 따른 disk full 이슈로 DB 서 비스 중지 발생 - data size가 큰 table을 partitioning 처리하여 backup후 truncate 하는 구조로 로직 변경 Memory 부족 memory 부족으로 인한 DB 서비스 중지 발생 (DBMS) - my.cnf 설정의 memory 옵션 조정으로 서버 사양에 맞게 조정하 여 DB 서비스 복구 Schema 관리 user 실수로 table schema 문제 발생 - 개발자가 기존 table schema를 재 생성 하면서 컬럼 누락으로 이슈 발생, 확인 후 table 재 생성 DB 서비스중지 DB 서버 재부팅으로 인한 서비스 중단 발생 - VM의 OS 오류로 인한 서버 재 부팅 발생으로 VM 이슈 확인 CPU 사용률 증가 OS CPU 사용률 증가로 인한 DB query 지연 발생 - 개발 서비스 SQL문제로 인하여 개발 소스 수정 후 조치 완료 - 실행계획 확인 후 인덱스 추가조치 완료
  • 94. 332 MySQL Error  MySQL Error – Error Messages 확인 – Error log 확인 – MySQL https://dev.mysql.com/doc/mysql-errors/8.0/en/error-reference-introduction.html - MariaDB https://mariadb.com/kb/en/mariadb-error-codes/ https://mariadb.com/kb/en/operating-system-error-codes/
  • 95. 333 MySQL InnoDB Recovery  InnoDB Recovery – Crash된 응급상황에서는 innodb_force_recovery 서버변수 설정 0 : 기본값, 정상상황 1 : 누락된 데이터, 손상된 페이지 감지 무시 2 : Undo 로그 삭제 무시 3 : roll-forward 수행 오류 무시 4 : Insert Buffer 손상 무시 5 : Undo 로그 무시하고 강제 COMMIT 6 : roll-forward 무시, Redo 손상에 대한 강제복구 – 0 ~ 6의 순서로 데이터베이스기동 (실패하면 다음 값으로 데이터베이스 시작) – 데이터베이스 시작이 성공 하면 mysqldump로 백업 / 복원
  • 96. 334 MySQL Online DDL  Online DDL – COPY – INPLACE – NOCOPY – INSTANT https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl.html https://mariadb.com/kb/en/innodb-online-ddl-overview/
  • 97. 335 MySQL Online DDL Operation Instant In Place Rebuilds Table Permits Concurrent DML Only Modifies Metadata Adding a column Yes Yes No Yes No Dropping a column No Yes Yes Yes No Renaming a column No Yes No Yes Yes Reordering columns No Yes Yes Yes No Setting a column default value Yes Yes No Yes Yes Changing the column data type No No Yes No No Extending VARCHAR column size No Yes No Yes Yes Dropping the column default value Yes Yes No Yes Yes Changing the auto-increment value No Yes No Yes No Making a column NULL No Yes Yes Yes No Making a column NOT NULL No Yes Yes Yes No Modifying the definition of an ENUM or SET column Yes Yes No Yes Yes  Online DDL Support for Column Operations
  • 100. 338
  • 101. Next Opensource Cloud Value Bonus
  • 103. 341 MariaDB MaxScale  MaxScale BSL (Business Source License) BSL은 Closed Source 또는 Open Core 라이선스 모델의 새로운 대안입니다. BSL에서 소스 코드는 항상 자유롭게 사용할 수 있으며 특정 시점 (즉, 변경 날짜)에 오픈 소스가 될 수 있습니다. BSL의 특정 수준 이하의 사용은 항상 완전 무료입니다. 지정된 수준 (고급 사용자) 이상으로 사용하면 변경 날짜까지 공급 업체 라이선스가 필요하며 이 시점에서 모든 사용은 무료가 됩니다. (참고 https://mariadb.com/bsl-faq-mariadb ) Additional Use Grant: You may use the Licensed Work when your application uses the Licensed Work with a total of less than three server instances for any purpose. Version First Release Latest version Latest release MaxScale 2.2 2017-10-12 2.2.21 2019-05-08 MaxScale 2.3 2018-10-09 2.3.20 2020-06-05 MaxScale 2.4 2019-06-29 2.4.17 2021-03-08 MaxScale 2.5 2020-06-18 2.5.13 2021-06-04 Version BSL change date MaxScale 2.2.21 2020-01-01 MaxScale 2.3.12 2022-01-01 MaxScale 2.3.13 2023-10-29 MaxScale 2.3.20 2024-06-02 MaxScale 2.4.6 2024-01-15 MaxScale 2.4.13 2024-10-14 MaxScale 2.5.5 2024-10-14 MaxScale 2.5.11 2025-04-28
  • 104. 342 Docker container  MySQL docker https://hub.docker.com/_/mysql
  • 105. 343 K8S Operator  Percona Kubernetes Operators https://www.percona.com/software/percona-kubernetes-operators The Percona Kubernetes Operators automate the creation, alteration, or deletion of members in your Percona Distribution for MySQL, MongoDB, or PostgreSQL environment. It can be used to instantiate a new environment, or to scale an existing environment. The Operator contains all necessary Kubernetes settings to provide a proper and consistent Percona XtraDB Cluster, Percona Server for MongoDB, or Percona Distribution for PostgreSQL instance. Kubernetes Operators provide a way to package, deploy, and manage a Kubernetes application. A Kubernetes application is deployed on Kubernetes and managed using the Kubernetes APIs and tooling. Operators help in building cloud-native applications by delivering automation advantages like deploying, scaling, and backup and restore while being able to run anywhere Kubernetes is deployed.
  • 106. Next Opensource Cloud Value NeoClova
  • 107. 345 NeoClova 회사명 임직원 대표이사 설립년도 주소 대표전화 홈페이지 주식회사 네오클로바 19명 이 재 중 2011년 11월 서울시 강서구 양천로 583, 우림블루나인 B동 12층 02-539-4880 www.neoclova.co.kr 기업 개요 주요 파트너쉽 주요사업분야 IT 통합유지보수 Red Hat Enterprise Linux, JBoss, Apache / Tomcat, MySQL / MariaDB / Percona Technical Support Red Hat Ready Partner T2 Partner Registered Partner Registered Partner Registered Partner
  • 108. 346 NeoClova reference 주요 고객사 구축 부분 오픈소스 구축 업무분석 운영지원 컨설팅 - 운영시스템 전반 유지보수 - 장애 및 성능 분석 지원 - U.Key 3.0 U2L PI - Unix Oracle RAC to Linux구축 - Jboss EWS/EAP 전환 및 성능 측정 - MySQL/MariaDB 컨설팅 서비스 - 통합시스템 내 리눅스 부분 유지보수 및 분석 지원 - 정보시스템 클라우드 전환 컨설팅 (ISP) - 전체운영시스템 클라우드 전환 ISP - G-Box플랫폼 구축 관련 오픈소스 지원 - ITO 오픈소스 컴플라이언스 검증 - New Kt.com 구축 관련 오픈소스 지원 - 오픈소스 SW 전사기술지원 - 가족관계 등록정보시스템 구축 사업내 오픈소스 구축 - 온라인 출생신고시스템 전산장비 도입 사업내 오픈소스 구축 - 스마트 산업입지 플랫폼 시범사업 전산장비 구축내 오픈소스 부분 - 빅데이터 기반의 차세대 공장설립온라인지원시스템 구축내 오픈소스 부분 - 차세대 운영정보시스템 구축내 오픈소스 부분 - 운영시스템 오픈소스(Linux부분) 운영지원 - 운영시스템 통합유지보수 지원
  • 109. 347 NeoClova 지원제품 List 1.3 Amazon Web Services 2.1 Red Hat OpenStack Platform 3.1 MySQL 4.1 Red Hat JBoss EAP 2.4 Red Hat Gluster Storage 5.1 Red Hat Enterprise Linux 1.1 Google Cloud Platform 2.2 Red Hat OpenShift Container Platform 2.3 Red Hat Ceph Storage 2.6 Azure Stack 2.5 Red Hat Virtualization 3.2 MariaDB 4.2 Red Hat JBoss Web Server 1.2 Microsoft Azure 4.3 Red Hat OpenShift 4.4 ACCORDION 4.5 Apache / Tomcat / NginX 5.2 CentOS 5.3 Ubuntu 5.4 Oracle Linux 3.4 DBMON-Star(DB 모니터링 자체솔루션) 3.5 DB CHECKER(DataBase 검증 및 자체튜닝 솔루션) 3.3 Percona Server for MySQL