swoft-component icon indicating copy to clipboard operation
swoft-component copied to clipboard

Update Connection.php

Open andiechang opened this issue 4 years ago • 1 comments

What does this PR do?

fix this issue: https://github.com/swoft-cloud/swoft/issues/1365

Does this fix any issues or need any specific reviewers?

Fixes: swoft-cloud/swoft#1365 Reviewers: @inhere @sakuraovq

Motivation

question: 生產環境大量連線時,會出現 MySQL server has gone away。

MySQL setting: interactive_timeout = 60 wait_timeout = 60

swoft: db 使用讀寫分離設定 db.pool 設定:

'db.pool' => [
        'class' => Pool: :class,
        'database' => bean('db'),
        'minActive' => 10,
        'maxActive' => 30,
        'maxWait' => 15,
        'maxWaitTime' => 15,
        'maxIdleTime' => 30,
    ]

More

  • [ ] Added/updated tests
  • [ ] Added/updated documentation new or old

Additional Notes

andiechang avatar Aug 20 '21 09:08 andiechang

你这代码格式变动太大了吧 :(

inhere avatar Sep 01 '21 13:09 inhere