【发布时间】:2020-01-07 15:33:55
【问题描述】:
我在 Google Cloud Platform 中创建了一个 MySQL 数据库。
Machine type is db-n1-standard-2 with 2 vCPUs and 7.5 GB Memory.
Network throughput (MB/s) is 500 of 2000
Storage type: SSD
Disk throughput (MB/s)
Read: 4.8
Write 4.8
IOPS
Read: 300
Write: 300
Availability: High availability
Database Flags:
max_connections: 500
我使用 Laravel Lumen 创建了一个 API,并让它在 Google Cloud Platform 上运行到 App Engine 中
runtime: php72
instance_class: F2
automatic_scaling:
min_instances: 1
max_instances: 20
target_cpu_utilization: 0.7
max_concurrent_requests: 80
target_throughput_utilization: 0.8
如果我使用邮递员向我的 API 发送请求,则第一个响应需要 1123 毫秒。响应大小为 8.59 KB。
如果我在 1 分钟内使用 loader.io 向 250 个客户端发送相同的请求, 测试中止,因为它达到了错误阈值。 79.5% 错误率 平均响应 = 9141 毫秒
最小/最大响应时间为:2081/10376 响应计数成功:104 响应计数超时:403
当我查看 MySQL 错误日志时,我确实有很多这样的错误:
2020-01-07 16:29:18.670 CET
2020-01-07T15:29:18.670275Z 1507 [Note] Aborted connection 1507 to db: 'mydatabasename' user: 'mydatabaseuser' host: 'cloudsqlproxy~172.217.35.158' (Got an error reading communication packets)
有人有想法,我该如何解决这个问题?
【问题讨论】:
标签: mysql google-app-engine google-cloud-sql