mysql - 不同的mysql超时是什么意思

标签 mysql ruby-on-rails timeout database-connection

我在互联网上搜索了很多,但没有找到任何关于 mysql 超时的简要说明和示例。我想知道下面列出的 mysql 差异超时的含义,还想知道我们为什么以及何时使用它们。

+----------------------------+----------+
| Variable_name              | Value    |
+----------------------------+----------+
| connect_timeout            | 10       |
| delayed_insert_timeout     | 300      |
| innodb_lock_wait_timeout   | 50       |
| interactive_timeout        | 28800    |
| net_read_timeout           | 3        |
| net_write_timeout          | 60       |
| slave_net_timeout          | 3600     |
| wait_timeout               | 28800    |
+----------------------------+----------+

另外,在 ruby​​ on rails 应用程序中,我可以在我的 database.yml 文件中设置 read_timeout。如果查询无法在指定的 read_timeout 值内读取数据,mysql 将关闭连接。所以我也想知道 net_read_timeoutread_timeout

有什么区别

谢谢,

最佳答案

来自 The Ultimate Guide to Ruby Timeouts

connect (or open) - time to open the connection

read (or receive) - time to receive data after connected

write (or send) - time to send data after connected

checkout - time to checkout a connection from the pool

statement - time to execute a database statement

关于mysql - 不同的mysql超时是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34250104/

相关文章:

mysql - MySQL是否有并发控制生成自增值?

ruby-on-rails - 需要更改 S3 Bucket 中文件的存储 "directory"(Carrierwave/Fog)

Ubuntu 上的 Mysql : ERROR 1045 (28000)

php - MySQL/PHP : Select Where with multiple conditions does not work

mysql - 我如何知道 Amazon RDS 中 MySQL 数据库快照的原始大小?

ruby-on-rails - Searchkick/Elasticsearch完全匹配

ruby-on-rails - 如何在 rails View 中显示数组?

angular 2可观察超时第二个参数类型

configuration - 如何配置 TestStack.White 超时?

python - Python 模块 INSTABOT 登录问题