如何计算我的 Google 云 SQL 需要的 CPU、内存和存储空间的数量
How to calculate the number of CPU, memory and storage that my Google Cloud SQL needs
我的数据库已达到 CPU 利用率的 100%,增加 CPU 的数量不再有效。
创建我的 Google Cloud SQL 我应该考虑哪些信息?您如何设置数据库配置?
我掌握的信息:
- 每天 10-50 分钟,我有 120 request/seconds,CPU 达到 100% 的利用率
- 在此关键时期内存使用量最大为2.5GB
- 存储使用量目前约为 1.3GB
当前配置:
vCPUs: 10
Memory: 10 GB
SSD storage: 50 GB
遗憾的是,没有确定正确数据库大小的神奇公式。这是因为查询的负载是可变的——有些小而简单,根本不需要时间,而另一些则复杂或庞大,需要大量资源才能完成。
通常有两种应对高负载的策略:减少负载(使用连接池、优化查询、缓存结果),或增加数据库的大小(添加额外的 CPU、存储或读取副本) .
通常,当我们有CPU 利用率时,那是因为CPU 超载或者我们在同一个实例中有太多的数据库表。以下是 Google’s documentation 提供的一些常见问题和修复:
If CPU utilization is over 98% for 6 hours, your instance is not properly sized for your workload, and it is not covered by the SLA.
If you have 10,000 or more database tables on a single instance, it could result in the instance becoming unresponsive or unable to perform maintenance operations, and the instance is not covered by the SLA.
当 CPU 过载时,建议使用此文档 view the percentage of available CPU 您的实例在 Google 云控制台的实例详细信息页面上使用。
还建议监控您的 CPU 使用情况并在指定阈值接收警报,设置 Stackdriver alert。
Increasing the number of CPUs 为您的实例应该减少您的实例的压力。请注意,更改 CPUs 需要重启实例。如果您的实例已经达到 CPU 的最大数量,请将您的数据库分片到多个实例。
Google 非常 interesting documentation 关于调查高利用率并确定系统或用户任务是否导致高 CPU 利用率。您可以使用它来对您的实例进行故障排除并找出导致高 CPU 利用率的原因。
我的数据库已达到 CPU 利用率的 100%,增加 CPU 的数量不再有效。 创建我的 Google Cloud SQL 我应该考虑哪些信息?您如何设置数据库配置?
我掌握的信息:
- 每天 10-50 分钟,我有 120 request/seconds,CPU 达到 100% 的利用率
- 在此关键时期内存使用量最大为2.5GB
- 存储使用量目前约为 1.3GB
当前配置:
vCPUs: 10
Memory: 10 GB
SSD storage: 50 GB
遗憾的是,没有确定正确数据库大小的神奇公式。这是因为查询的负载是可变的——有些小而简单,根本不需要时间,而另一些则复杂或庞大,需要大量资源才能完成。
通常有两种应对高负载的策略:减少负载(使用连接池、优化查询、缓存结果),或增加数据库的大小(添加额外的 CPU、存储或读取副本) .
通常,当我们有CPU 利用率时,那是因为CPU 超载或者我们在同一个实例中有太多的数据库表。以下是 Google’s documentation 提供的一些常见问题和修复:
If CPU utilization is over 98% for 6 hours, your instance is not properly sized for your workload, and it is not covered by the SLA.
If you have 10,000 or more database tables on a single instance, it could result in the instance becoming unresponsive or unable to perform maintenance operations, and the instance is not covered by the SLA.
当 CPU 过载时,建议使用此文档 view the percentage of available CPU 您的实例在 Google 云控制台的实例详细信息页面上使用。
还建议监控您的 CPU 使用情况并在指定阈值接收警报,设置 Stackdriver alert。
Increasing the number of CPUs 为您的实例应该减少您的实例的压力。请注意,更改 CPUs 需要重启实例。如果您的实例已经达到 CPU 的最大数量,请将您的数据库分片到多个实例。
Google 非常 interesting documentation 关于调查高利用率并确定系统或用户任务是否导致高 CPU 利用率。您可以使用它来对您的实例进行故障排除并找出导致高 CPU 利用率的原因。