Skip to content

Conversation

andiechang
Copy link
Contributor

What does this PR do?

fix this issue: swoft-cloud/swoft#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

fix this issue: swoft-cloud/swoft#1365

MySQL setting:
interactive_timeout = 60
wait_timeout = 60

swoft:
db 使用讀寫分離設定

question:
生產環境大量連線時,會出現 MySQL server has gone away。
@inhere inhere added enhancement New feature or request kind/db labels Aug 20, 2021
@inhere
Copy link
Member

inhere commented Sep 1, 2021

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

@inhere inhere added the PR: processing work in process label Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kind/db PR: processing work in process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pool error is Create connection error(SQLSTATE[HY000] [2006] MySQL server has gone away)
2 participants