0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MySQLのメモリ関連確認コマンド (都度追記)

Last updated at Posted at 2019-05-18

パラメータチューニングなどメモリ関連のパラメータ設定する際に使用できるかも。

トータルメモリサイズを導出するSQL(メモリ設定変更後など確認用)

SELECT
  @GLOBAL_BUFFER := (@@GLOBAL.KEY_BUFFER_SIZE + @@GLOBAL.INNODB_BUFFER_POOL_SIZE + @@GLOBAL.INNODB_LOG_BUFFER_SIZE) as GLOBAL_BUFFER_SIZE,
  @THREAD_BUFFER := (@@GLOBAL.NET_BUFFER_LENGTH + @@GLOBAL.SORT_BUFFER_SIZE + @@GLOBAL.READ_BUFFER_SIZE + @@GLOBAL.JOIN_BUFFER_SIZE + @@GLOBAL.READ_RND_BUFFER_SIZE) as THREAD_BUFFER_SIZE,
  @TOTAL_MEMORY  := (@GLOBAL_BUFFER + (@THREAD_BUFFER * @@GLOBAL.MAX_CONNECTIONS)) as TOTAL_MEMORY_SIZE,
  @TOTAL_MEMORY / 1024 / 1024 / 1024 as TOTAL_MEMORY_SIZE_gb;

innodb_buffer_pool_sizeとinnodb_log_file_sizeをさくっと確認したい時

read -sr MYSQL_PWD_INPUT
※root@localhostのパスワードを入力
 
MYSQL_PWD="$MYSQL_PWD_INPUT" mysql -e "SHOW GLOBAL VARIABLES LIKE 'innodb_%_size';"|grep "pool_s\|log_f
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?