Posts

Showing posts from April, 2021

How to see server resources from their point of view

Image
In this article I have tried to explain how flow of information is seen from a resource point of view. I know this is very basic, but remember good knowledge of basic things help you understand more complex things easily. This knowledge will also help you to create or understand monitoring graph provided by various applications like Percona Monitoring and Management. PS: I am not in their marketing team, I just have done hands on it and I love it that's why mentioned here. 😄 I believe the image is self explanatory but defining the terms here for completeness. CPU No Description. Memory Pages read from disk and written to Memory. Pages read from Memory and written to disk. Disk Pages read from Disk and written to memory. Pages read from memory and written to Disk. Network Interface When information is send to the Network interface, it is called Request/Bytes Read/Inbound and when it is retrieved from Network Interface then it is called Response/Bytes Written/Outbound.

How to retrieve schema from a MySQL database using mysqldump

This article defines a method for extracting schema from a particular MySQL database, without dumping the data from the tables. This procedure can be helpful in cases of migration where you want schema but not the data of target database. For example, checking if Application DB for version X can be migrated to Application DB version Y. Dump Table Structure mysqldump -h localhost -u root -proot@123 -P3306 --single-transaction --skip-comments --no-data --skip-routines --skip-triggers --skip-events --add-drop-database --set-gtid-purged=OFF --hex-blob --databases emsent_dplicense | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | sed -e 's/DEFINER[ ]*=[ ]*[^*]*PROCEDURE/PROCEDURE/' | sed -e 's/DEFINER[ ]*=[ ]*[^*]*FUNCTION/FUNCTION/' > ems52_schema_tables.sql  Dump Routines, Triggers and Events Structure mysqldump -h localhost -u root -proot@123 -P3306 --single-transaction --skip-comments --no-create-db --no-data --no-create-info --routines --triggers --events --

How to diagnose a MySQL deadlock

In this article I will show case a deadlock example encountered in a API call in our application. Quick Links 1. Deadlock Output 2. Understanding MySQL deadlock 3. How to avoid a MySQL deadlock NOTE:  The blog I referred is: How to deal with MySQL deadlocks A deadlock in MySQL happens when two or more transactions mutually hold and request for locks, creating a cycle of dependencies. In a transaction system, deadlocks are a fact of life and not completely avoidable. InnoDB automatically detects transaction deadlocks, rollbacks a transaction immediately and returns an error. It uses a metric to pick the easiest transaction to rollback. Though an occasional deadlock is not something to worry about, frequent occurrences call for attention. Before MySQL 5.6, only the latest deadlock can be reviewed using SHOW ENGINE INNODB STATUS command. But with Percona Toolkit’s pt-deadlock-logger you can have deadlock information retrieved from SHOW ENGINE
Back To Top