Optimize write performance for AWS Aurora instance

前端 未结 3 1606
梦如初夏
梦如初夏 2020-12-29 10:33

I\'ve got an AWS Aurora DB cluster running that is 99.9% focused on writes. At it\'s peak, it will be running 2-3k writes/sec.

I know Aurora is somewhat optimized by

3条回答
  •  隐瞒了意图╮
    2020-12-29 10:57

    For Googlers:

    • Aurora needs to write to multiple replicas in real time, thus there must be a queue w/ locking, waiting, checking mechanisms
    • This behavior inevitably causes ultra high CPU utilization and lag when there are continuous writing requests which only succeed when multiple replicas are sync'd
    • This has been around since Aurora's inception, up til 2020, which is logically difficult if not impossible to solve if we were to keep the low storage cost and fair compute cost of the service
    • High-volume writing performance of Aurora MySQL could be more than 10x worse than RDS MySQL (from personal experience and confirmed by above answers)

    To solve the problem (more like a work-around):

    • BE CAREFUL with Aurora if more than 5% of your workload is writing
    • BE CAREFUL with Aurora if you need near real-time result of large volume writing
    • Drop secondary indices as @Bill Karwin points out to improve writing
    • Batch apply inserts and updates may improve writing

    I said "BE CAREFUL" but not "DO NOT USE" as many scenarios could be solved by clever architecture design. Database writing performance can be hardly depended on.

提交回复
热议问题