Here's a brief hands-on to get started with MySQL Server performance tuning. I'll show basic options to get started and have the right basics settings. Hope you'll enjoy!
Using galera replication to create geo distributed clusters on the wanSakari Keskitalo
We will show the advantages of having a geo-distributed database cluster and how to create one using Galera Cluster for MySQL. We will also discuss the configuration and status variables that are involved and how to deal with typical situations on the WAN such as slow, untrusted or unreliable links, latency and packet loss. We will demonstrate a multi-region cluster on Amazon EC2 and perform some throughput and latency measurements in real-time.
MySQL Administrator
Basic course
- MySQL 개요
- MySQL 설치 / 설정
- MySQL 아키텍처 - MySQL 스토리지 엔진
- MySQL 관리
- MySQL 백업 / 복구
- MySQL 모니터링
Advanced course
- MySQL Optimization
- MariaDB / Percona
- MySQL HA (High Availability)
- MySQL troubleshooting
네오클로바
http://neoclova.co.kr/
Slidedeck presented at http://devternity.com/ around MongoDB internals. We review the usage patterns of MongoDB, the different storage engines and persistency models as well has the definition of documents and general data structures.
How to Analyze and Tune MySQL Queries for Better Performanceoysteing
The document discusses techniques for optimizing MySQL queries for better performance. It covers topics like cost-based query optimization in MySQL, selecting optimal data access methods like indexes, the join optimizer, subquery optimizations, and tools for monitoring and analyzing queries. The presentation agenda includes introductions to index selection, join optimization, subquery optimizations, ordering and aggregation, and influencing the optimizer. Examples are provided to illustrate index selection, ref access analysis, and the range optimizer.
- The document discusses advanced techniques for optimizing MySQL queries, including topics like temporary tables, file sorting, order optimizations, and calculated fields.
- It provides examples of using indexes and index optimizations, explaining concepts like index types, index usage, key lengths, and covering indexes.
- One example shows how to optimize a query involving a calculated year() expression by rewriting the query to use a range on the date field instead.
Using galera replication to create geo distributed clusters on the wanSakari Keskitalo
We will show the advantages of having a geo-distributed database cluster and how to create one using Galera Cluster for MySQL. We will also discuss the configuration and status variables that are involved and how to deal with typical situations on the WAN such as slow, untrusted or unreliable links, latency and packet loss. We will demonstrate a multi-region cluster on Amazon EC2 and perform some throughput and latency measurements in real-time.
MySQL Administrator
Basic course
- MySQL 개요
- MySQL 설치 / 설정
- MySQL 아키텍처 - MySQL 스토리지 엔진
- MySQL 관리
- MySQL 백업 / 복구
- MySQL 모니터링
Advanced course
- MySQL Optimization
- MariaDB / Percona
- MySQL HA (High Availability)
- MySQL troubleshooting
네오클로바
http://neoclova.co.kr/
Slidedeck presented at http://devternity.com/ around MongoDB internals. We review the usage patterns of MongoDB, the different storage engines and persistency models as well has the definition of documents and general data structures.
How to Analyze and Tune MySQL Queries for Better Performanceoysteing
The document discusses techniques for optimizing MySQL queries for better performance. It covers topics like cost-based query optimization in MySQL, selecting optimal data access methods like indexes, the join optimizer, subquery optimizations, and tools for monitoring and analyzing queries. The presentation agenda includes introductions to index selection, join optimization, subquery optimizations, ordering and aggregation, and influencing the optimizer. Examples are provided to illustrate index selection, ref access analysis, and the range optimizer.
- The document discusses advanced techniques for optimizing MySQL queries, including topics like temporary tables, file sorting, order optimizations, and calculated fields.
- It provides examples of using indexes and index optimizations, explaining concepts like index types, index usage, key lengths, and covering indexes.
- One example shows how to optimize a query involving a calculated year() expression by rewriting the query to use a range on the date field instead.
Krzysztof Ksiazek - Severalnines AB
So, you are a developer or sysadmin and showed some abilities in dealing with databases issues. And now, you have been elected to the role of DBA. And as you start managing the databases, you wonder…
* How do I tune them to make best use of the hardware?
* How do I optimize the Operating System?
* How do I best configure MySQL or MariaDB for a specific database workload?
If you're asking yourself the following questions when it comes to optimally running your MySQL or MariaDB databases, then this talk is for you!
We will discuss some of the settings that are most often tweaked and which can bring you significant improvement in the performance of your MySQL or MariaDB database. We will also cover some of the variables which are frequently modified even though they should not.
Performance tuning is not easy, especially if you're not an experienced DBA, but you can go a surprisingly long way with a few basic guidelines.
This presentation is for people who want to understand how PostgreSQL shares information among processes using shared memory. Topics covered include the internal data page format, usage of the shared buffers, locking methods, and various other shared memory data structures.
MySQL Administrator
Basic course
- MySQL 개요
- MySQL 설치 / 설정
- MySQL 아키텍처 - MySQL 스토리지 엔진
- MySQL 관리
- MySQL 백업 / 복구
- MySQL 모니터링
Advanced course
- MySQL Optimization
- MariaDB / Percona
- MySQL HA (High Availability)
- MySQL troubleshooting
네오클로바
http://neoclova.co.kr/
The presentation covers improvements made to the redo logs in MySQL 8.0 and their impact on the MySQL performance and Operations. This covers the MySQL version still MySQL 8.0.30.
This presentation describes how to configure and leverage ProxySQL with
AWS Aurora,
Azure Database for MySQL
and CloudSQL for MySQL.
It details the various benefits, configuration, and monitoring.
The paperback version is available on lulu.com there http://goo.gl/fraa8o
This is the first volume of the postgresql database administration book. The book covers the steps for installing, configuring and administering a PostgreSQL 9.3 on Linux debian. The book covers the logical and physical aspect of PostgreSQL. Two chapters are dedicated to the backup/restore topic.
The document discusses atomic DDL operations in MySQL 8.0. It describes the requirements for a transactional data dictionary storage engine and storage engines that support atomic DDL. It provides examples of how DDL statements like CREATE TABLE, DROP TABLE, and DROP SCHEMA are implemented atomically in MySQL 8.0 using a single transaction, compared to previous versions where these operations were not fully atomic. This ensures consistency after DDL operations and prevents issues like orphan files or tables.
The document discusses the Performance Schema in MySQL. It provides an overview of what the Performance Schema is and how it can be used to monitor events within a MySQL server. It also describes how to configure the Performance Schema by setting up actors, objects, instruments, consumers and threads to control what is monitored. Finally, it explains how to initialize the Performance Schema by truncating existing summary tables before collecting new performance data.
※다운로드하시면 더 선명한 자료를 보실 수 있습니다.
동접 200만 명이 접속할 수백 대의 게임 서버가 최소한의 MySQL 서버만으로 서비스할 수 있는 구조를 설명합니다.
고성능/고효율의 MySQL 스케일링 기법을 공유합니다. 대규모 게임 서비스에서 이미 검증된 것은 안 비밀~
목차
1. 기본적인 아기텍처
2. ProxySQL을 이용한 더 나은 아키텍처
3. 최종 아키텍처
대상
- 대규모 게임 서비스에 MySQL을 사용한 경험에 관심 있는 분
- ProxySQL에 관심이 있는 서버 개발자 혹은 DBA
- 게임 서버 개발 과정에서 DB 쪽을 유연하게 구성하고 싶은 분
■관련 동영상: https://youtu.be/8Eb_n7JA1yA
How To Set Up SQL Load Balancing with HAProxy - SlidesSeveralnines
We continuously see great interest in MySQL load balancing and HAProxy, so we thought it was about time we organised a live webinar on the topic! Here is the replay of that webinar!
As most of you will know, database clusters and load balancing go hand in hand.
Once your data is distributed and replicated across multiple database nodes, a load balancing mechanism helps distribute database requests, and gives applications a single database endpoint to connect to.
Instance failures or maintenance operations like node additions/removals, reconfigurations or version upgrades can be masked behind a load balancer. This provides an efficient way of isolating changes in the database layer from the rest of the infrastructure.
In this webinar, we cover the concepts around the popular open-source HAProxy load balancer, and show you how to use it with your SQL-based database clusters. We also discuss HA strategies for HAProxy with Keepalived and Virtual IP.
Agenda:
* What is HAProxy?
* SQL Load balancing for MySQL
* Failure detection using MySQL health checks
* High Availability with Keepalived and Virtual IP
* Use cases: MySQL Cluster, Galera Cluster and MySQL Replication
* Alternative methods: Database drivers with inbuilt cluster support, MySQL proxy, MaxScale, ProxySQL
PostgreSQL continuous backup and PITR with BarmanEDB
How can I achieve an RPO of 5 minutes for the backups of my PostgreSQL databases? And what about RPO=0 for zero data loss backups? This talk will give you answers to those questions, by guiding you through an overview of Disaster Recovery of PostgreSQL databases with Barman, covering its key concepts and providing useful patterns and tips.
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016Geir Høydalsvik
The document discusses performance improvements in MySQL 5.7 compared to previous versions. Key points include:
- MySQL 5.7 is up to 3 times faster than MySQL 5.6 and 6 times faster than 5.5 according to benchmarks. Faster performance is achieved through improvements to the InnoDB storage engine, new optimizer cost model, and other enhancements.
- New features in 5.7 like parallel replication, native JSON support, and InnoDB spatial indexing improve performance for specific use cases like replication, JSON querying, and GIS searching.
- The MySQL Router was introduced as a way to route connections and transactions for increased performance, high availability, and scalability.
This is an in-depth introduction to MySQL Performance Tuning. We will review best practices, the most important configuration options, discuss the initial MySQL configuration file, monitoring, and more!
Learn how to find the queries most in need of optimization using performance reports in MySQL Workbench, MySQL Enterprise Monitor, or through the sys schema.
Krzysztof Ksiazek - Severalnines AB
So, you are a developer or sysadmin and showed some abilities in dealing with databases issues. And now, you have been elected to the role of DBA. And as you start managing the databases, you wonder…
* How do I tune them to make best use of the hardware?
* How do I optimize the Operating System?
* How do I best configure MySQL or MariaDB for a specific database workload?
If you're asking yourself the following questions when it comes to optimally running your MySQL or MariaDB databases, then this talk is for you!
We will discuss some of the settings that are most often tweaked and which can bring you significant improvement in the performance of your MySQL or MariaDB database. We will also cover some of the variables which are frequently modified even though they should not.
Performance tuning is not easy, especially if you're not an experienced DBA, but you can go a surprisingly long way with a few basic guidelines.
This presentation is for people who want to understand how PostgreSQL shares information among processes using shared memory. Topics covered include the internal data page format, usage of the shared buffers, locking methods, and various other shared memory data structures.
MySQL Administrator
Basic course
- MySQL 개요
- MySQL 설치 / 설정
- MySQL 아키텍처 - MySQL 스토리지 엔진
- MySQL 관리
- MySQL 백업 / 복구
- MySQL 모니터링
Advanced course
- MySQL Optimization
- MariaDB / Percona
- MySQL HA (High Availability)
- MySQL troubleshooting
네오클로바
http://neoclova.co.kr/
The presentation covers improvements made to the redo logs in MySQL 8.0 and their impact on the MySQL performance and Operations. This covers the MySQL version still MySQL 8.0.30.
This presentation describes how to configure and leverage ProxySQL with
AWS Aurora,
Azure Database for MySQL
and CloudSQL for MySQL.
It details the various benefits, configuration, and monitoring.
The paperback version is available on lulu.com there http://goo.gl/fraa8o
This is the first volume of the postgresql database administration book. The book covers the steps for installing, configuring and administering a PostgreSQL 9.3 on Linux debian. The book covers the logical and physical aspect of PostgreSQL. Two chapters are dedicated to the backup/restore topic.
The document discusses atomic DDL operations in MySQL 8.0. It describes the requirements for a transactional data dictionary storage engine and storage engines that support atomic DDL. It provides examples of how DDL statements like CREATE TABLE, DROP TABLE, and DROP SCHEMA are implemented atomically in MySQL 8.0 using a single transaction, compared to previous versions where these operations were not fully atomic. This ensures consistency after DDL operations and prevents issues like orphan files or tables.
The document discusses the Performance Schema in MySQL. It provides an overview of what the Performance Schema is and how it can be used to monitor events within a MySQL server. It also describes how to configure the Performance Schema by setting up actors, objects, instruments, consumers and threads to control what is monitored. Finally, it explains how to initialize the Performance Schema by truncating existing summary tables before collecting new performance data.
※다운로드하시면 더 선명한 자료를 보실 수 있습니다.
동접 200만 명이 접속할 수백 대의 게임 서버가 최소한의 MySQL 서버만으로 서비스할 수 있는 구조를 설명합니다.
고성능/고효율의 MySQL 스케일링 기법을 공유합니다. 대규모 게임 서비스에서 이미 검증된 것은 안 비밀~
목차
1. 기본적인 아기텍처
2. ProxySQL을 이용한 더 나은 아키텍처
3. 최종 아키텍처
대상
- 대규모 게임 서비스에 MySQL을 사용한 경험에 관심 있는 분
- ProxySQL에 관심이 있는 서버 개발자 혹은 DBA
- 게임 서버 개발 과정에서 DB 쪽을 유연하게 구성하고 싶은 분
■관련 동영상: https://youtu.be/8Eb_n7JA1yA
How To Set Up SQL Load Balancing with HAProxy - SlidesSeveralnines
We continuously see great interest in MySQL load balancing and HAProxy, so we thought it was about time we organised a live webinar on the topic! Here is the replay of that webinar!
As most of you will know, database clusters and load balancing go hand in hand.
Once your data is distributed and replicated across multiple database nodes, a load balancing mechanism helps distribute database requests, and gives applications a single database endpoint to connect to.
Instance failures or maintenance operations like node additions/removals, reconfigurations or version upgrades can be masked behind a load balancer. This provides an efficient way of isolating changes in the database layer from the rest of the infrastructure.
In this webinar, we cover the concepts around the popular open-source HAProxy load balancer, and show you how to use it with your SQL-based database clusters. We also discuss HA strategies for HAProxy with Keepalived and Virtual IP.
Agenda:
* What is HAProxy?
* SQL Load balancing for MySQL
* Failure detection using MySQL health checks
* High Availability with Keepalived and Virtual IP
* Use cases: MySQL Cluster, Galera Cluster and MySQL Replication
* Alternative methods: Database drivers with inbuilt cluster support, MySQL proxy, MaxScale, ProxySQL
PostgreSQL continuous backup and PITR with BarmanEDB
How can I achieve an RPO of 5 minutes for the backups of my PostgreSQL databases? And what about RPO=0 for zero data loss backups? This talk will give you answers to those questions, by guiding you through an overview of Disaster Recovery of PostgreSQL databases with Barman, covering its key concepts and providing useful patterns and tips.
What's new in MySQL 5.7, Oracle Virtual Technology Summit, 2016Geir Høydalsvik
The document discusses performance improvements in MySQL 5.7 compared to previous versions. Key points include:
- MySQL 5.7 is up to 3 times faster than MySQL 5.6 and 6 times faster than 5.5 according to benchmarks. Faster performance is achieved through improvements to the InnoDB storage engine, new optimizer cost model, and other enhancements.
- New features in 5.7 like parallel replication, native JSON support, and InnoDB spatial indexing improve performance for specific use cases like replication, JSON querying, and GIS searching.
- The MySQL Router was introduced as a way to route connections and transactions for increased performance, high availability, and scalability.
This is an in-depth introduction to MySQL Performance Tuning. We will review best practices, the most important configuration options, discuss the initial MySQL configuration file, monitoring, and more!
Learn how to find the queries most in need of optimization using performance reports in MySQL Workbench, MySQL Enterprise Monitor, or through the sys schema.
This document provides an overview of MySQL server performance tuning. It discusses laying the foundation for performance tuning by examining the server, OS, network and filesystem. It also covers examining current server settings and status variables, and tuning various aspects of MySQL like InnoDB, MyISAM, queries and session settings. The document aims to provide guidance on areas to optimize to improve MySQL server performance.
This document discusses various topics related to MySQL administration including access control, diagnostic data, log files, and backups. It provides examples of how to configure user accounts and privileges using commands like CREATE USER, ALTER USER, GRANT, and REVOKE. It also explains how to view diagnostic information using SHOW commands, the INFORMATION_SCHEMA, and the SYS schema. Finally, it covers MySQL's different log files and various options for logical and physical backups.
20190817 coscup-oracle my sql innodb cluster sharingIvan Ma
The document provides an agenda for a presentation on MySQL InnoDB Cluster. It discusses MySQL replication components, demonstrating MySQL InnoDB Cluster, network stability, operations, backup and recovery, GTID consistency, replication between clusters, and troubleshooting. It also covers MySQL innovations from version 5.7 to 8.0 and options for configuring an InnoDB Cluster, including consistency settings and member weights.
The document discusses several new features and improvements in MySQL 8.0, including a transactional data dictionary, persisted server configuration, MySQL roles for access control, common table expressions and window functions for developers, and continued enhancements for JSON, UUID, security, replication, and GIS. It also outlines the goals for MySQL InnoDB Cluster to provide an integrated high availability and scaling solution.
Going thru the era of IoT that involves lots more and much bigger data, we need a faster database. MySQL 5.7 gives you 3x speed of its predecessor and able to reach 1.6m qps on our select benchmark.
The document discusses performance improvements and new features in MySQL 5.7. Key points include:
- MySQL 5.7 shows significant performance gains over previous versions, with benchmarks showing 3x faster query performance and 82% faster connection throughput.
- New features include enhanced replication, a new optimizer cost model, performance schema improvements, and native JSON support.
- The optimizer and parser were refactored for improved maintainability, readability and stability. A new cost-based optimizer model provides better performance and tunability.
The document describes the MySQL SYS schema, which provides views, procedures, and functions to help database administrators, developers, and operations teams perform common debugging and tuning tasks. It includes summary views that breakdown user activity by I/O usage, stages, and statement details. The SYS schema also includes views and functions for analyzing I/O performance and retrieving the latest file I/O events. It can be installed on MySQL servers to provide a standardized way of accessing performance data.
Netherlands Tech Tour - 07 MySQL Whats upcoming in 5.7Mark Swarbrick
This document provides information about performance improvements and new features in MySQL 5.7. It includes benchmarks showing MySQL 5.7 outperforming previous versions in tasks like point selects, InnoDB throughput, and connections per second. New capabilities in 5.7 like InnoDB improvements, replication, MySQL Fabric, and security enhancements are highlighted. The refactoring of MySQL 5.7's parser and optimizer to be more modular and extensible is also summarized.
The document provides an overview of using Python to connect to and query a MySQL database configured for high availability. It discusses MySQL replication, group replication, and connectors that enable multi-host connections. It also demonstrates connecting to MySQL from Python, executing queries, handling errors, and implementing a simple web application using Flask that connects to MySQL to call a stored procedure.
The document provides an overview of MySQL including:
- MySQL is an open-source relational database management system that runs as a server providing multi-user access to databases.
- MySQL 5.6 introduced improvements to performance, scalability, InnoDB, optimization, replication, and added new capabilities like NoSQL access to InnoDB and a MySQL Hadoop applier.
- MySQL Enterprise Edition offers additional high availability, security, scalability, and monitoring features over the community version through components like the MySQL Thread Pool which improves scalability as user connections grow.
MySQL 5.7 provides significant performance improvements and new features over previous versions. Benchmark tests showed it was 3x faster than MySQL 5.6 for SQL point selects and connection requests, and 1.5x faster for OLTP read/write workloads. New features include enhanced InnoDB storage engine capabilities, improved replication, JSON data type support, and increased security.
This document summarizes benchmarks of MySQL multi-thread slave performance using different numbers of slave_parallel_workers threads on Oracle Cloud MySQL instances. It finds that using 16 threads provides the best performance, processing queries faster and keeping the slave less behind the master compared to lower thread counts. CPU usage is also lower with 16 threads even though more threads are used.
Basic MySQL Troubleshooting for Oracle DBAsSveta Smirnova
The document discusses troubleshooting MySQL performance issues. It begins with an introduction to MySQL architecture including installation layout, log files, connectors, storage engines, and plugins. It then covers basic troubleshooting techniques such as checking access privileges, using EXPLAIN to analyze query plans, and reviewing system variables and startup options that could affect performance. Methods for interpreting error messages and using the INFORMATION_SCHEMA database to obtain metadata are also summarized.
The document discusses MySQL performance tuning basics. It covers key topics like defining performance metrics, MySQL server architecture, commands and tools for monitoring performance like slow query log and processlist, and server configuration parameters that impact performance like connection settings and buffer sizes. The presentation aims to provide an overview of MySQL performance optimization.
MySQL replication allows data from a master database server to be copied to one or more slave database servers. It provides advantages like improving performance through load balancing, increasing data security with backups on slaves, and enabling analytics on slaves without impacting the master. Basic replication involves setting up a master server and slave server with unique IDs, configuring the master to log binary changes, and pointing the slave to the master so it can copy the binary log entries.
20190615 hkos-mysql-troubleshootingandperformancev2Ivan Ma
MySQL Troubleshooting in Hong Kong Open Source Conference 2019 - how to use sys.diagnostics(...) and using the dimitri (http://dimitrik.free.fr/) Tools for performance analysis.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...IJECEIAES
Climate change's impact on the planet forced the United Nations and governments to promote green energies and electric transportation. The deployments of photovoltaic (PV) and electric vehicle (EV) systems gained stronger momentum due to their numerous advantages over fossil fuel types. The advantages go beyond sustainability to reach financial support and stability. The work in this paper introduces the hybrid system between PV and EV to support industrial and commercial plants. This paper covers the theoretical framework of the proposed hybrid system including the required equation to complete the cost analysis when PV and EV are present. In addition, the proposed design diagram which sets the priorities and requirements of the system is presented. The proposed approach allows setup to advance their power stability, especially during power outages. The presented information supports researchers and plant owners to complete the necessary analysis while promoting the deployment of clean energy. The result of a case study that represents a dairy milk farmer supports the theoretical works and highlights its advanced benefits to existing plants. The short return on investment of the proposed approach supports the paper's novelty approach for the sustainable electrical system. In addition, the proposed system allows for an isolated power setup without the need for a transmission line which enhances the safety of the electrical network
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
Advanced control scheme of doubly fed induction generator for wind turbine us...IJECEIAES
This paper describes a speed control device for generating electrical energy on an electricity network based on the doubly fed induction generator (DFIG) used for wind power conversion systems. At first, a double-fed induction generator model was constructed. A control law is formulated to govern the flow of energy between the stator of a DFIG and the energy network using three types of controllers: proportional integral (PI), sliding mode controller (SMC) and second order sliding mode controller (SOSMC). Their different results in terms of power reference tracking, reaction to unexpected speed fluctuations, sensitivity to perturbations, and resilience against machine parameter alterations are compared. MATLAB/Simulink was used to conduct the simulations for the preceding study. Multiple simulations have shown very satisfying results, and the investigations demonstrate the efficacy and power-enhancing capabilities of the suggested control system.
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSIJNSA Journal
The smart irrigation system represents an innovative approach to optimize water usage in agricultural and landscaping practices. The integration of cutting-edge technologies, including sensors, actuators, and data analysis, empowers this system to provide accurate monitoring and control of irrigation processes by leveraging real-time environmental conditions. The main objective of a smart irrigation system is to optimize water efficiency, minimize expenses, and foster the adoption of sustainable water management methods. This paper conducts a systematic risk assessment by exploring the key components/assets and their functionalities in the smart irrigation system. The crucial role of sensors in gathering data on soil moisture, weather patterns, and plant well-being is emphasized in this system. These sensors enable intelligent decision-making in irrigation scheduling and water distribution, leading to enhanced water efficiency and sustainable water management practices. Actuators enable automated control of irrigation devices, ensuring precise and targeted water delivery to plants. Additionally, the paper addresses the potential threat and vulnerabilities associated with smart irrigation systems. It discusses limitations of the system, such as power constraints and computational capabilities, and calculates the potential security risks. The paper suggests possible risk treatment methods for effective secure system operation. In conclusion, the paper emphasizes the significant benefits of implementing smart irrigation systems, including improved water conservation, increased crop yield, and reduced environmental impact. Additionally, based on the security analysis conducted, the paper recommends the implementation of countermeasures and security approaches to address vulnerabilities and ensure the integrity and reliability of the system. By incorporating these measures, smart irrigation technology can revolutionize water management practices in agriculture, promoting sustainability, resource efficiency, and safeguarding against potential security threats.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
I would like to discuss today about the main points a DBA has to consider when addressing the most important topic about service availability: performance. In partcular this will be a walkthrough the most important aspcts and configuration parameters to check, what should be analyzed when our Server is «slow», and understand that we may be stressing our system more than needed, so the perception that better hardware implies better performance, is not always true.
You may have surely heard that quote saying «Premature optimization is the root of all evil». And this is actually true, as in the moment we deploy our service, we can’t know what will happen in the future, what levels of concurrency will we observe, what will be the first bottlenecks to appear. Nevertheless it’s good to know what parameters we can tune from the very beginning so to forecast future impacts and prevent them from degrading our service quality.
Let’s have a quick look at the content for this session, after introducing you to the tools we’ll use to perform the Hands On Lab, we’ll show some working examples of configurations to scale connections. This topic will be tackled by addressing connections threshold and threading model. After that, I’ll show how I/O is impacted by the two main actors in a MySQL Server: REDO logging and InnoDB buffer pool.
Finally, I’ll show how to improve execution plan for a query with a concrete example. Let’s go!
In order to perform these simple exercises over Linux OS, I have installed sysstat, available from repository.
I have also provisioned MySQL Server with employees DB, which is a reference open source DB useful for a wide set of benchmarks.
Here’s all the details for Employees DB. Besides that, I will be using mysqlslap util, which is an emulation client to simulate concurrency and to benchmark a server.
Following exercises and topics will be based on InnoDB.
Server configuration is the default, so I did not edit my.cnf configuration file.
I also recommend to restart the server before trying these exercises, so to reset all counters and statistics.
Let’s have a quick look at the connection model in a MySQL Server. In the default configuration scenario, to one connection corresponds a thread. Thread is in charge of authentication and after that, performs all the needed tasks to execute the query and return results to the client.
It is easy to understand where the bottleneck may be if you grow quick with number of connections, as every thread needs resources to execute.
Remember to make configuration changes persistent to /etc/my.cnf
We have seen how to increase the maximum number of connections allowed, MySQL Server won’t reject connections if existing concurrent connections will stay within the limits configured. But this is not a good practice, as creating an arbitrary number of connections will provoke rejection sooner or later. A client side solution for intelligent scalability, is using connection pooling. Connection pooling is a technique of creating and managing a pool of connections that are ready for use by any thread that needs them. Connection pooling can increase performance of your application, as pulling an existing connection from the pool will reduce overheads to create and dispose it and will allow for more concurrent clients to access the database.
Now that we know that a connection needs a thread created on the server to manage authentication and process all the tasks related to query execution, let’s dig a little bit to understand how to improve thread management. One asset to improve concurrency and reduce overhead when a thread is created and disposed, is the thread cache. Manager threads create a new thread when necessary but try to avoid doing so by consulting the thread cache. But… how many threads can fit into the thread cache?
Thread cache is configurable, and this can be done by setting thread_cache_size.
There is also a set of parameters to monitor how thread cache is doing and understand if it is big enough.
From previous execution, we see that almost 300 0 thousands threads have been created, this seems high, with the little uptime and number of operations I executed after restart.
Let’s observe how threads are created when mysqlslap utility is launched again. Now Threads_created has increased by almost 1000!
Let’s fix this situation and let’s choose a bigger size for our thread cache. With high concurrency, I expect all the threads in the cache will be used, therefore to higher concurrency, I should choose a bigger cache size.
After setting a bigger cache size, let’s run again our test. This time I notice just a little increase of around 100 threads. These are the new threads created to be stored into the cache size and will be kept for future operations.
Purpose of setting the size of thread cache size, is avoiding new threads are created. So as a rule of thumb, rememember to monitor threads_created when choosing the right size for thread cache.
So far we have discovered how to increment connections limit and how to cache threads. These tunings can help expand our server capabilities and scale connections beyond what originally planned. Nevertheless, this is not efficient and a bottleneck will be hit after certain number of threads are executing. Solution to scalability passes through using connection pools client side, as mentioned, and adopting an improved threads model, server side. MySQL Enterprise Thread Pool addresses the typical pattern «one thread per connection» by allowing an improved threads model, reducing context switching and contention.
Let’s talk now about the REDO log, a disk based data structure used during during crash recovery. In practical terms, it’s a set of files, 2 by default, written in circular fashion before a transaction is committed. This represents the «D» in ACID, that is durability. Every change done to the database, must be logged so the transaction can be recovered in case the database crash and changes have not been applied to the tablespace.
Let’s take a look at REDO logging most important parameters. When talking about REDO, main concern should have the right size so to incur into checkpointing issue. To a too small REDO log, corresponds a high rotation rate and a forced buffer pool checkpoint: we cannot permit transactions logged in the REDO are overwritten when REDO rotates, so InnoDB forces a buffer pool checkpoint: during this phase, all pages not yet synchronized to disk, are flushed. This forced flush can represent a bottleneck, as transactions are stopped until flush completes.
Recommendation is to increase REDO log file size accordingly to avoid this mechanism be triggered.
Apart from this impact, I would like to show the effect REDO logging has on I/O. When commit-related I/O operations are rearranged and done in batches against REDO log, performance improves. innodb_flush_log_at_trx_commit allows controlling this behavior. When it is set to 1, at every transactions commit corresponds a REDO log flush. By setting to 0, transactions are written and flushed every second. This will reduce overhead dramatically, as will save overhead by doing a flush for every transaction commit. Let’s see the different impacts this tuning has in terms of I/O pressure.
To show effects on I/O, let’s have two console sessions at hand, on the first, we will execute mysqlslap as usual, and on the second, let’s use iostat to monitor I/O usage. In particular, parameters chosen will set a report every 2 seconds on the storage device where REDO logs are stored.
Here’s the output, notice the number of write requests and bandwith utilization of the device in the last column.
Now let’s use a mysql client session to set innodb_flush_log_at_trx_commit=0. Please keep in mind that this exercise helps understand how REDO logging keeps I/O busy, but flushing transactions once per second may provoke up to one second of transactions loss in case of crash, so be careful about using it, typical useful scenarios may be replication slaves or test instances. Let’s run again in the first console mysqlslap. Let’s observe again output for iostat in the second console.
You can notice how the bandwith, therefore I/O usage has dramatically decreased. When you are binlogging, REDO logging, UNDO logging and checkpointing buffer pool to disk, it is important to monitor I/O so it does not become our bottleneck.
Just a couple of further details: you can monitor I/O by checking related status variable and also using sys schema, not only for REDO, but for all files written by InnoDB.
We have seen how important it is to keep I/O usage under control. InnoDB buffer pool is the key layer to increase performance by reducing accesses to disk whenever data is requested by a statement. This storage area is in memory and is a cache to ensure fast access to data and avoid innecessary I/O reads.
The bigger buffer pool, the better. So as a rule of thumb, buffer pool should be as big as possible to hold all data frequently accessed in memory. There are different rules around, like making buffer pool use 80% of your system memory, but in reality, better option to size buffer pool is monitoring how buffer pool is effectively used.
To the purpose, there are different parameters, being statistics from information_schema the most important, we will refer to them in the following example.
Let’s run once again our mysqlslap benchmark tool in a console session and consult in another session what is reported by information_schema.
I can tell mysqlskap to stress my data base instance by using a customer query, so this time I chose a bad query, SELECT * FROM employees is doing a scan and requesting all table content, therefore it will read as much data as possible from the buffer pool and return it to the client.
Let’s focus at HIT_RATE: as you see, value of 1000 means that all data is successfully retrieved from buffer pool. So far, so good. Our buffer pool with default configuration and this traffic model is good enough. I/O is not accessed to fetch records from pages.
To show the role of buffer pool, let’s now shrink it to the minimum size, by acting on innodb_buffer_pool_chunk_size and innodb_buffer_pool_size I can resize it at will. After restarting the server (note that buffer pool can be changed online, without any restart, but when chunk size is reconfigured, restart is needed).
Let’s run again our benchmarking query and check information_schema
Here oyu can see pool_size is smaller, and hit_rate is not 1000 anymore. To the smaller buffer pool, more I/O accesses are needed.
So the typical question we hear at Support is «My query is slow, why?» This problem may be addressed by redesigning a query and by using the right set of indexes so suggest MySQL optimizer the fast execution path to retrieve resulting records. In this case, using the right index for a query corresponds to reduced I/O accesses and better performance.
Execution plan is key to understand what is the perfromance for a query. Let’s see it with an example. I have chosen a slighly different than the typical query, based on a function of the column in the where filter clause. Indeed the query may be rewritten for better efficiency, but let’s keep it for educational purposes.
By checking the explain plan, a full table scan is performed, almost 300.000 thousands rows are read. Optimizer need an index to filter only those records we need. So why not adding an index on hire_date? We can certainly do that, but it won’t improve our execution plan.
What’s happening? Let’s see in the next slide.
When filter is on a function of the column, optimizer can’t kick in so we need to use an index on a generated column. This translates into: «let’s precalculate the function and add an index on it». After this change, optimizer will finally be able to get only the rows we need. Look at the difference, 300,000 rows versus 111!
We have gone through some basic tuning to address any immediate performance problem, to wrap up: