Help us understand the problem. What is going on with this article?

MySQL の wait_timeout を変更。

More than 5 years have passed since last update.

接続維持時間をデフォルトの 8 時間から 1 分に変更。
この設定、接続のアイドル状態が一定時間続くと MySQL 側から自動的に接続を切る設定らしい。

うかつに低く設定すると、バッチ処理とかのときに考慮が必要になりそう。

稼働中のサーバで変更。

> set global wait_timeout=60;
> show global variables like '%wait%';
+---------------------------------------------------+----------+
| Variable_name                                     | Value    |
+---------------------------------------------------+----------+
| innodb_lock_wait_timeout                          | 120      |
| innodb_spin_wait_delay                            | 6        |
| lock_wait_timeout                                 | 31536000 |
| performance_schema_events_waits_history_long_size | 10000    |
| performance_schema_events_waits_history_size      | 10       |
| wait_timeout                                      | 60       |
+---------------------------------------------------+----------+
6 rows in set (0.00 sec)

my.cnf に書く場合こんな感じ。

[mysqld]
wait_timeout = 60
ignis
累計7000万DL超のスマホアプリを自社企画・開発 ツール系からマンガ、ゲームなど幅広いジャンルのアプリを展開
http://1923.co.jp/service-information
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした