2019年7月10日に開催された「WEBエンジニア MeetUp@札幌 #6 MySQL Special」での発表資料です。 発表時の資料に少し説明を加筆・修正してから公開しています。 ※追加で以下の更新をしました。(2019年7月19日) - MTSを効率化するための設定に関して、WRITE…
こんにちは、アプリケーション基盤チームの青木(@a_o_k_i_n_g)です。先日親知らずを抜歯した時、つらすぎたので MySQL の JOIN のことを考えて心の平静を保っていました。 サイボウズの製品のひとつである kintone はニーズに応じて自由に業務アプリのようなものを手軽に作ることができ、データの検索条件やソート条件も細かくカスタマイズ可能で、様々なレベルでのアクセス権も設定可能という非常に便利なツールです。 しかしその機能を支える裏側では複雑なクエリが発行され、MySQL に多大な負荷をかけています。サイボウズのクラウドには数十テラバイトに登る MySQL データがあり、数千万件オーダーのテーブルを複数 JOIN するクエリが毎秒のように実行されるという、エンジニア魂が滾る環境です。 現在サイボウズでは性能改善に力を入れており、僕もその業務に従事しています。例えば2018年
こんにちは、サービス開発部の荒引 (@a_bicky) です。 突然ですが、RDBMS の既存のテーブルを見てみたら「何でこんなにインデックスだらけなの?」みたいな経験はありませんか?不要なインデックスは容量を圧迫したり、挿入が遅くなったりと良いことがありません。 そんなわけで、今回はレコードを検索するために必要なインデックスの基礎知識と、よく見かける不適切なインデックスについて解説します。クックパッドでは Rails のデータベースとして主に MySQL 5.6、MySQL のストレージエンジンとして主に InnoDB を使っているので、MySQL 5.6 の InnoDB について解説します。 InnoDB のインデックスに関する基礎知識 インデックスの構造 (B+ 木) InnoDB では B+ 木が使われています。B+ 木は次のような特徴を持った木構造です。 次数を b とすると、
必要メモリ量=グローバルバッファのサイズ+(各スレッドのバッファサイズの合計 × 最大接続数(max_connections)) 各スレッドのバッファサイズの合計とは、以下の値の合計値です。 sort_buffer_size myisam_sort_buffer_size read_buffer_size join_buffer_size read_rnd_buffer_size グローバルバッファのサイズは、以下の値の合計値です。 key_buffer_size innodb_buffer_pool_size innodb_log_buffer_size innodb_additional_mem_pool_size net_buffer_length ※実践ハイパフォーマンスMySQL による とあるのだが、一般的にいわれてる計算式はさらにそれに+query_cache_sizeがプラ
ここでは、EC2の上でinnodbをチューニングして使うという観点でTIPSをまとめてみた。 RDS便利だから使おうぜってのは今回の話のスコープには含みません。 あと、innodbについて、割りとちゃんと調べてみたのは初めてだったりするので、間違ってる点など見つけたらぜひご指摘くださいませ。 innodb関連 バッファプール ワーキングセットを乗せておくオンメモリのバッファ領域。読み書き共にこの領域を経由して実施される。 参照時はバッファプール上でデータを探して、なければテーブルスペースから取得する。(そのデータはバッファプール上に格納される) 書き込み時はリクエストを受け付けてワーキングセットを更新し、ログの書き込みへ移行する。 設定はinnodb_buffer_pool_size 監視はSHOW ENGINE INNODB STATUSか、mysqladmin extended-sta
パフォーマンススキーマとは パフォーマンススキーマはMySQL 5.5から実装された性能統計情報に関するメタデータを格納するスキーマです。MySQL 5.5ではメタデータ取得のオーバーヘッドが大きく、本番運用時に利用することは推奨していませんでしたが、MySQL 5.6ではオーバーヘッドが大幅に改善されデフォルトで有効となっています。 パフォーマンススキーマは性能統計情報を記録するストレージエンジンの一種として実装されており、performance_schemaスキーマのテーブルに格納された処理のレイテンシ(ピコ秒単位)やデータのバイト数、ソースでの位置、オブジェクトのデータなどに対してSQLでアクセス可能です。MySQLサーバのソースコード中にある“instrumentation point”(または“instrument”と表現される)にて「イベント」毎の処理時間や処理データ量
サイバーエージェント公式ブログをご覧の皆さんこんばんは、インフラ&コアテク本部の須藤(@strsk)です。普段はAmebaのソーシャルゲーム全般のインフラを見つつ、日本語ラップの啓蒙をしながら弊社社員を素材にコラ画像をつくったりしています。好きなAAは麻呂です。 はい、というわけで今回はMySQLインデックスチューニングの基本的な流れについてまとめてみました。 ソーシャルゲームは更新も参照もめちゃくちゃ多いです。数秒のレプリケーション遅延も致命的なので適切なテーブル、クエリとインデックス設計が重要です。(何でもそうですけど)インデックスが多くなると更新コストなどが懸念されますが、インデックスが正しく使われていないクエリを放置している方が悪です。そんなこんなで、割と例も偏ったりしてるかもしれませんがあしからず。 前提としてはInnoDBを想定しています。MyISAMはほとんど使っていません。
에버노트에 뭐가 새로워요?에버노트에서 무슨 일이 일어나고 있는지 궁금하신가요? 아래의 기사들을 확인하여 우리가 작업 중인 흥미로운 것들을 모두 볼 수 있습니다. 새로운 소식레거시 버전 Evernote 앱 사용 중지2024년 3월 26일, 저희는 레거시 버전 Evernote 앱에 작별을 고합니다. v10 이전의 Evernote 경험을 단일화하면 보안 수준을 크게 높이고 더 빠른 개발을 위해 더 많은 자원을 투입할 수 있습니다. 더 읽기 14가지 주요 기능이 이제 모든 사용자에게 제공됩니다이 중요한 Evernote 기능들은 검색, 첨부 관리, 노트 액세스 등 핵심적인 제품 성능을 높여줍니다. 이제 누구나 그 기능을 사용해 Evernote의 잠재성을 최대한 활용할 수 있습니다.
去る2014/03/01(土)の OSC 2014 Tokyo/Spring でMyNAとしてセミナーの枠をいただいたので、おはなしししてきました。 雨の中たくさんの方に足を運んでいただきました。本当にどうもありがとうございました。 "MySQLパラメーターチューニングの理屈と定石"と銘打って、普段アプリを書いているような人向けに、俺が普段やってるパラメーターチューニングと同じくらいのことが誰にでもできるように…とか思って資料を作っていたんですが(社内のDB勉強会に使うネタのうち、パラメーター調整の部分だけを切り出した、というのがもともとのコンセプトです)、作れば作るほど、いかに自分が「考えるな。感じるんだ」でチューニングしているのかをむしろ思い知らされました。 「これとこれ見るでしょ? そうするとなんか変な感じがするじゃない? で、こことここだからこれかなって。いじってみたら違うから、近
これだけ見れば大丈夫!ーMySQLパフォーマンス監視のツボ(クエリ編) こんにちは、インフラ担当新人の nob です。 サーバー監視ツールで MySQL を監視しているのにデータが多すぎて活用していない。という方はいませんか?その豊富なデータをパフォーマンス・チューニングに活用しない手はありません。今回はサーバー監視ツールのグラフを読み解いた実戦経験を元に、「これだけ見れば大丈夫」というツボをまとめてみました。 これだけ見れば大丈夫! クエリ編 3つのつぼと5つのグラフ (その1)監視ツールが何を見ているのか知る (その2)監視のキモ、グラフ3点セット (Questions, Lock Waits と Transaction Handler) (その3)グラフでチェックする SQL チューニング ( Select Type と Handler) シンプルでお勧め、サーバー監視グラフ化ツール
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く