This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws --profile=aws-profile s3 cp s3://bucket-from s3://bucket-to --recursive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Редко, но может пригодиться посмотреть, какие запросы на запись шли в базу (в первую очередь стоит смотреть на логи в kibana, но на крайняк можно и бинлоги mysql посмотреть, если не получается понять, что происходило). | |
| Заходим на слэйв базу | |
| ssh yandex-mysql-slave | |
| Смотрим, какие есть бинлоги | |
| ls /var/lib/mysql/ -l | grep mysql-bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (let orderId of orderIds) { | |
| try { | |
| await save(orderId) | |
| } catch(e) {console.log(e)} | |
| await sleep(1000) | |
| } | |
| function sleep(ms) { | |
| return new Promise(resolve => setTimeout(resolve, ms)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select * from performance_schema.table_io_waits_summary_by_index_usage | |
| where object_schema = 'db_name' AND object_name='table_name'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DATA_LENGTH, TABLE_NAME AS "Table", ROUND((index_length / 1024 / 1024), 2) AS "Index Size (MB)", ROUND((data_length / 1024 / 1024), 2) AS "Data Size (MB)" | |
| FROM information_schema.tables | |
| WHERE table_schema = 'db'; | |
| -- Данные по каждому индексу | |
| SELECT database_name, table_name, index_name, ROUND(stat_value * @@innodb_page_size / 1024 / 1024, 2) size_in_mb | |
| FROM mysql.innodb_index_stats | |
| WHERE stat_name = 'size' | |
| AND index_name != 'PRIMARY' | |
| AND table_name='<need_table_name>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT database, table, formatReadableSize(sum(bytes_on_disk)) AS table_size FROM system.parts WHERE 1 /*database = 'logs'*/ GROUP BY database, table ORDER BY sum(bytes_on_disk) DESC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git diff --cached --name-only | grep "php" | xargs php -l | grep -v "No syntax errors" | |
| #Для php 7.4 | |
| git diff --cached --name-only | grep "php" | xargs -L1 php7.4 -l | grep -v "No syntax errors" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mysqlbinlog --base64-output=decode-rows /var/lib/mysql/mysql-bin.000071 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UPDATE swap_test SET x=(@temp:=x), x = y, y = @temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| queues=$(./rabbitmqadmin list queues | grep " | 0" | grep "delay" | awk '{print $2}'); | |
| for queue in $queues | |
| do | |
| cmd="./rabbitmqadmin get queue='$queue'" |
NewerOlder