2022-06-01ãã1ã¶æéã®è¨äºä¸è¦§
ryuichi1208.hateblo.jp ã£ã¦ããè¨äºãæ¸ãã¦ä¸å¹´ãçµã£ããããã¾ã§ã®çµé¨ä¸èªåã¯å¯¾æ°é¢æ°çãªæé·ãéãããããªãã¨ãå¤ãã¦ããããéåããããªããã ãæºãã£ã¦ããµã¼ãã¹ã§ããããã£ã¡ã ãç¥ããªããã¨ãå¤æãããå¦ã³ã ããã®ç°å¢ãinnodbã¨ã1â¦
/proc/${PID}/fdinfo/${fd} ã§è¦ããã¨ãã§ãããflagsã¯openã«æå®ã§ãããã©ã°ã®å¤ãè¨å®ããã¦ãããposã§ãã¡ã¤ã«ãªãã»ãããåå¾ã§ããã®ã¯ä½ãã«ä½¿ãããï¼ã¨ãªã£ãã(ãã¡ã¤ã«ãå é ããèªã¿è¾¼ãã§ä½ããããããã°ã©ã ã§éä¸ã§åºãã£ã¦åããªãã¿ãâ¦
nginx.org proxy_ignore_client_abortã¯ããã©ã«ãå¤ãOFFã®è¨å®ã§ONã«ããã¨ä»¥ä¸ã®ãããªåãã«ãªãã ã¯ã©ã¤ã¢ã³ããå¿çãå¾ ããã«æ¥ç¶ãéããã¨ãã«ããããã·ããããµã¼ãã¨ã®æ¥ç¶ãéãããã©ããã決å®ãã¾ãã ããã¯ä½ãå¬ãããã¨ããã¨ãªãã¼ã¹â¦
éã¦ãã¼ã¯ã¤ã³ããã¯ã¹ã®å ´åã¯ãç価æ¡ä»¶ã§ãã£ã¦ãç¯å²æ¡ä»¶ã«è¿ãããã¯ãåãã¨ãã話ã空æ¯ã£ã¦ãªãã¦ãæã£ãããããã¯åºãï¼ï¼ã£ã¦ãªãã±ã¼ã¹ã¨ãã¯ããã®å¯è½æ§ããããããã¦ãã¼ã¯å¶ç´ã®ä»ãã¦ããªãã«ã©ã ã«ã¯åå¤ãå ¥ãããã¨ãã§ãããããç¾â¦
ãã¼ãã«ã®ããã¯ç¶æ ã確èªããæ¹æ³ ãã¼ãã«ã®ããã¯ç¶æ ã確èªããã«ã¯ãinnodb_lock_waitsã確èªãããã¨ã§ããã¯ããã¦ããç¶æ ãåå¾ã§ãã¾ãã SELECT * FROM sys.innodb_lock_waits; ãã¼ãã«ã®ãã㯠ãã¼ãã«ãããã¯ããã«ã¯ãLOCK TABLESæã使â¦
ãã©ã¤ããªã¤ã³ããã¯ã¹ã«å¯¾ããç価æ¤ç´¢ã空æ¯ã lock_mode X locks gap before rec select * from t1 where id = 5 for update; ------------ TRANSACTIONS ------------ Trx id counter 1957 Purge done for trx's n:o < 1939 undo n:o < 0 state: runninâ¦
www.percona.com ãã使ãã㤠--group-by fingerprintã¨ãã§ã¾ã¨ãããã¨ãã«ä½¿ãã --order-by query_timeã¨ãlock_timeã¨ãrows_examinedã®åè¨ã§ã½ã¼ãããããã§ãã ãã®ä» åºåå½¢å¼ãè²ã ãã£ã¦ã¯ã³ã©ã¤ãã¼ã¨ãCIã¨ãã¨çµã¿åããã¦ãªã«ãã§ãããã¨â¦
qiita.com ãããã©ã³ã¶ã¯ã·ã§ã³ã®ããã¯ãä»ã®ãã©ã³ã¶ã¯ã·ã§ã³ã®ããã¯ç²å¾ãå¾ ããã¦ããã¿ãããªã®ãå¼ãã«ã¯information_schemaã®LOCKé¢ä¿ã®ãã¼ãã«ãJOINãã¦ããå¿ è¦ãããã¨æã£ã¦ãããä¸è¨ã®è¨äºãè¦ã¦ããã¨sysã«ãã£ã¨ä¾¿å©ã«ã¿ãããã¥ã¼ãããâ¦
writeããããã¼ã¿ãã¡ã¢ãªä¸ã«æã£ãã¾ã¾ã§ãããµã¤ãºã¨ããã®ã innodb_log_file_sizeãããã¦ã¾ã ãã£ã¹ã¯ã«ãã©ãã·ã¥ããã¦ããªããã¼ã¿(dirty page)ã®ãµã¤ãºã Checkpoint Age ã«ãªããinnodb_log_file_sizeã¨ãããµã¤ãºãå¢ããã¨ãã®ãµã¤ãºãå¢ãã¦â¦
SQLããã¼ã·ã³ã°ãã¾ã æä½å¯¾è±¡ã¨ãªããã¼ã¿ãã¼ã¸åä½ã§ã¡ã¢ãªã¼ä¸ã®Buffer Poolã«å¼ã³åºã ãã¼ã¿ã«æä½ãè¡ãããã®ãã¼ã¸ãDirty Pageã« Redo Logã«æä½ã¨æä½å¯¾è±¡ãã¼ã¿ã¼ãªã©æ å ±ãæ¸ã Redo Logããã¼ããã£ã¹ã¯ã«æ¸ãè¾¼ã Dirty Pageãï¼ãã¼ããã£â¦
select table_schema,table_name,index_name,column_name,seq_in_index from information_schema.statistics;
è²ã å¤ãããã±ã¼ãã«ã©ããããã£ã¦ãã£ã¨æ©ãã§ã pic.twitter.com/qBT6ba3hASâ Ryuichi@Gurasan:|| (@ryuichi_1208) 2022å¹´6æ1æ¥ å¿µé¡ã ã£ãã¹ã¿ã³ãã£ã³ã°ãã¹ã¯ãå¯å®¤ã«ç½®ãã¦å¯å®¤ã§ãä½æ¥ã§ããããã«ãã¦ã¿ããä»äºé¨å±ã¨å¯å®¤ã¨ãªãã³ã°ã§ä»äºã§ããâ¦