【发布时间】:2017-09-19 10:49:11
【问题描述】:
我试图了解它是什么以及它是如何计算 RDS Aurora DB 的 max_connection 的。 目前我们正在尝试使用 db.t2.small,它基于 AWS 文档允许 max_connections = 45
- 是 45 点/月吗?
- 谁能解释一下什么定义了 1 连接?是对数据库的查询吗?
- 如果是查询,如果查询返回 100 个值怎么办?这些是否算作连接?
谢谢 乔
【问题讨论】:
我试图了解它是什么以及它是如何计算 RDS Aurora DB 的 max_connection 的。 目前我们正在尝试使用 db.t2.small,它基于 AWS 文档允许 max_connections = 45
谢谢 乔
【问题讨论】:
我不是数据库专家,但我可以根据我的理解尝试回答您的问题。
1) 是 45 点/月吗?
No, the max_connections is not per month but the number of concurrent
connections allowed simultaneously.
2) 有人可以解释一下什么定义了 1 连接吗?是对数据库的查询吗?
Connection could either be a query or you trying to manually enter into the
database.
Since for a query to read/write into the database, it needs to open a
connection to the DB, hence it is also counted as one connection, as something
(read here as a piece of code)is connected to your database. It is the same thing
as you opening a client, typing username/password etc and entering into the DB.
3) 如果是查询,如果查询返回 100 个值怎么办?这些算不算连接?
The value returned by the query doesn't matter. It can return as many values as it
like(you need to handle that in your code though). What happens in the code is that
you open a connection and then run a query after that you close that connection.
What happens between when the connection open and closes doesn't affect the number
of connection.
However you need to take care of other parameters while running a long query into a
database. As it could spike your CPU/memory utilization etc. but the number of
connection per query would still be 1.
【讨论】: