Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RDS/Auroraパフォーマンスインサイトを使ってみる

B1dca90d4b3ffd2ccd918774e1ba170d?s=47 hmatsu47
January 28, 2021

 RDS/Auroraパフォーマンスインサイトを使ってみる

JAWS-UG 名古屋 いろんなパフォーマンスを学ぶ 2021/01/28

B1dca90d4b3ffd2ccd918774e1ba170d?s=128

hmatsu47

January 28, 2021
Tweet

Transcript

  1. None
  2. https://qiita.com/hmatsu47 ◦ https://qiita.com/hmatsu47/items/ceb75caf46e3c761095d ◦ ◦ https://booth.pm/ja/items/2524481 2

  3. • • ◦ ▪ ◦ ▪ 3

  4. • ◦ https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/AuroraUserGuide/USER_ PerfInsights.Overview.html • ◦ • ◦ 4

  5. 5

  6. 6

  7. • • ◦ ◦ ▪ ▪ 7

  8. 8

  9. • ◦ https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/AuroraUserGuide /AuroraMySQL.Reference.html#AuroraMySQL.Reference.Waitevents • ◦ https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/AuroraUserGuide /AuroraPostgreSQL.Reference.html#AuroraPostgreSQL.Reference.Waite vents 9

  10. • ◦ ▪ https://dev.mysql.com/doc/refman/5.7/en/wait-summary-tables.html ▪ https://dev.mysql.com/doc/refman/5.7/en/performance-schema-wait-tables.html ◦ ▪ https://dev.mysql.com/doc/refman/5.6/ja/wait-summary-tables.html ▪

    https://dev.mysql.com/doc/refman/5.6/ja/performance-schema-wait-tables.html 10
  11. • ◦ ▪ https://www.postgresql.jp/document/12/html/monitoring-stats.html#MONITORING-STAT S-VIEWS-TABLE ◦ ▪ https://www.postgresql.jp/document/12/html/monitoring-stats.html#WAIT-EVENT-TABLE 11

  12. • ◦ mysqlslap --auto-generate-sql --auto-generate-sql-guid-primary --engine=innodb --number-int-cols=20 --number-char-cols=20 --concurrency=100 --auto-generate-sql-write-number=2500

    --auto-generate-sql-execute-number=5000 --auto-generate-sql-load-type=【タイプ】 -u admin -h 【エンドポイント】 -p ◦ ▪ ◦ 12
  13. • ◦ pgbench -i -s 1000 -U postgres -h 【エンドポイント】

    -d pgbench ◦ pgbench -N -r -c 10 -j 10 -T 300 -U postgres -h 【エンドポイント】 pgbench ◦ 13
  14. • ◦ ▪ • ◦ https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/AuroraUserGuide/USER_ PerfInsights.API.html 14

  15. • [ { "Metric": "db.load.avg", "GroupBy": { "Group": "db.wait_event", "Limit":

    10 } } ] • aws pi get-resource-metrics \ > --service-type RDS \ > --identifier 【DBリソースID】 \ > --start-time 2021-01-24T06:10:00Z \ > --end-time 2021-01-24T06:11:00Z \ > --period-in-seconds 60 \ > --metric-queries file://query.json 15
  16. { "Identifier": "db-S7UPJNXAX6J7ZJWZXFUBTODYRI", "AlignedStartTime": 1611468600.0, "MetricList": [ { "Key": {

    "Metric": "db.load.avg" }, "DataPoints": [ { "Timestamp": 1611468660.0, "Value": 58.6 } ] }, 16
  17. 17 { "Key": { "Metric": "db.load.avg", "Dimensions": { "db.wait_event.type": "synch",

    "db.wait_event.name": "wait/synch/sxlock/innodb/fil_space_latch" } }, "DataPoints": [ { "Timestamp": 1611468660.0, "Value": 0.03333333333333333 } ] },
  18. 18 { "Key": { "Metric": "db.load.avg", "Dimensions": { "db.wait_event.type": "synch",

    "db.wait_event.name": "wait/synch/sxlock/innodb/fil_space_latch" } }, "DataPoints": [ { "Timestamp": 1611468660.0, "Value": 0.03333333333333333 } ] },
  19. { "Key": { "Metric": "db.load.avg", "Dimensions": { "db.wait_event.type": "synch", "db.wait_event.name":

    "wait/synch/mutex/innodb/trx_mutex" } }, "DataPoints": [ { "Timestamp": 1611468660.0, "Value": 0.016666666666666666 } ] } ], 19
  20. { "Key": { "Metric": "db.load.avg", "Dimensions": { "db.wait_event.type": "synch", "db.wait_event.name":

    "wait/synch/mutex/innodb/trx_mutex" } }, "DataPoints": [ { "Timestamp": 1611468660.0, "Value": 0.016666666666666666 } ] } ], 20
  21. • ◦ ◦ 21

  22. • ◦ ◦ 22

  23. • ◦ ◦ 23

  24. • ◦ • ◦ ◦ ◦ 24