如何在Amazon RDS Aurora数据库中增加MySQL查询缓存?

时间:2022-02-16 23:21:54

New to Amazon RDS, I'm looking for ways to deliver cached SELECT queries to enhance performance of a query heavy website (along with other features leading to interest in RDS). So far I've been able to setup an Amazon Aurora database, migrate an old MySQL database to it via MySQLWorkbench and run a test version of the website successfully. The website is connecting to Aurora remotely, running outside of AWS.

对于Amazon RDS来说,我是一个新手,我正在寻找方法来交付缓存的SELECT查询,以提高查询频繁的网站的性能(以及其他引起对RDS兴趣的特性)。到目前为止,我已经能够安装一个Amazon Aurora数据库,通过MySQLWorkbench将一个旧的MySQL数据库迁移到它,并成功地运行网站的测试版本。该网站正在与Aurora远程连接,运行在AWS之外。

I was reading that I could increase the MySQL Query Cache using queries, e.g. (16MB in this case):

我正在阅读,我可以使用查询增加MySQL查询缓存,例如(在本例中为16MB):

SET GLOBAL query_cache_size = 16777216

This requires higher privileges than the database user that can connect with remotely. The master user seems set for localhost access. If this is the correct route, how would I gain access to make edits via queries?

这需要比可以远程连接的数据库用户更高的权限。主用户似乎设置为localhost访问。如果这是正确的路径,我如何获得通过查询进行编辑的访问权限?

It also looks like I may be able to edit option groups. If that is the allowed route, I'm guessing I will need to set a specific option or add options (didn't see an add option for the default option group).

看起来我还可以编辑选项组。如果这是允许的路径,我猜我需要设置一个特定的选项或添加选项(没有看到默认选项组的添加选项)。

1 个解决方案

#1


2  

On an RDS instance, you will generally manage engine configuration like this through RDS parameter groups.

在RDS实例中,您通常通过RDS参数组来管理引擎配置。

AWS publishes a list of parameters that are available in Aurora MySQL parameter groups, and it appears that query_cache_size is modifiable as an instance-level parameter.

AWS发布一个在Aurora MySQL参数组中可用的参数列表,并且似乎可以将query_cache_size作为实例级参数进行修改。

There are some differences between Aurora cluster and instance level parameter groups that you should be aware of. Per the linked documentation above:

极光集群和实例级参数组之间有一些差异,您应该注意到这些差异。根据上述相关文件:

Cluster-level parameters are managed in DB cluster parameter groups. Instance-level parameters are managed in DB parameter groups. Although each DB instance in an Aurora MySQL DB cluster is compatible with the MySQL database engine, some of the MySQL database engine parameters must be applied at the cluster level, and are managed using DB cluster parameter groups. Cluster-level parameters are not found in the DB parameter group for an instance in an Aurora DB cluster and are listed later in this topic.

在DB集群参数组中管理集群级参数。实例级参数在DB参数组中进行管理。虽然Aurora MySQL DB集群中的每个DB实例都与MySQL数据库引擎兼容,但是一些MySQL数据库引擎参数必须在集群级别上应用,并使用DB集群参数组进行管理。在Aurora DB集群中,DB参数组中没有发现集群级别的参数,稍后将在本主题中列出。

You can manage both cluster-level and instance-level parameters using the AWS Management Console, the AWS CLI, or the Amazon RDS API. There are separate commands for managing cluster-level parameters and instance-level parameters. For example, you can use the modify-db-cluster-parameter-group AWS CLI command to manage cluster-level parameters in a DB cluster parameter group and use the modify-db-parameter-group AWS CLI command to manage instance-level parameters in a DB parameter group for a DB instance in a DB cluster.

您可以使用AWS管理控制台、AWS CLI或Amazon RDS API管理集群级别和实例级参数。对于管理集群级参数和实例级参数,有单独的命令。例如,您可以使用modify-db-cluster-parameter-group AWS CLI命令来管理DB集群参数组中的集群级参数,并使用modify-db-parameter-group AWS CLI命令来管理DB集群中的DB实例级参数组中的DB参数组中的实例级参数。

Further Reading

#1


2  

On an RDS instance, you will generally manage engine configuration like this through RDS parameter groups.

在RDS实例中,您通常通过RDS参数组来管理引擎配置。

AWS publishes a list of parameters that are available in Aurora MySQL parameter groups, and it appears that query_cache_size is modifiable as an instance-level parameter.

AWS发布一个在Aurora MySQL参数组中可用的参数列表,并且似乎可以将query_cache_size作为实例级参数进行修改。

There are some differences between Aurora cluster and instance level parameter groups that you should be aware of. Per the linked documentation above:

极光集群和实例级参数组之间有一些差异,您应该注意到这些差异。根据上述相关文件:

Cluster-level parameters are managed in DB cluster parameter groups. Instance-level parameters are managed in DB parameter groups. Although each DB instance in an Aurora MySQL DB cluster is compatible with the MySQL database engine, some of the MySQL database engine parameters must be applied at the cluster level, and are managed using DB cluster parameter groups. Cluster-level parameters are not found in the DB parameter group for an instance in an Aurora DB cluster and are listed later in this topic.

在DB集群参数组中管理集群级参数。实例级参数在DB参数组中进行管理。虽然Aurora MySQL DB集群中的每个DB实例都与MySQL数据库引擎兼容,但是一些MySQL数据库引擎参数必须在集群级别上应用,并使用DB集群参数组进行管理。在Aurora DB集群中,DB参数组中没有发现集群级别的参数,稍后将在本主题中列出。

You can manage both cluster-level and instance-level parameters using the AWS Management Console, the AWS CLI, or the Amazon RDS API. There are separate commands for managing cluster-level parameters and instance-level parameters. For example, you can use the modify-db-cluster-parameter-group AWS CLI command to manage cluster-level parameters in a DB cluster parameter group and use the modify-db-parameter-group AWS CLI command to manage instance-level parameters in a DB parameter group for a DB instance in a DB cluster.

您可以使用AWS管理控制台、AWS CLI或Amazon RDS API管理集群级别和实例级参数。对于管理集群级参数和实例级参数,有单独的命令。例如,您可以使用modify-db-cluster-parameter-group AWS CLI命令来管理DB集群参数组中的集群级参数,并使用modify-db-parameter-group AWS CLI命令来管理DB集群中的DB实例级参数组中的DB参数组中的实例级参数。

Further Reading