Skip to content

Optimize the performance and stability of TiDB running on AWS i3.xlarge/i3.2xlarge #18025

Open

Description

@scsldb

Description

Optimize the performance and stability of TiDB running on 8 virtual cores(vcores) environment(like AWS i3.2xlarge or m5.2xlarge).

Currently, in order to gain a better performance, one TiKV instance may require 12 or more vcores, this is not cost-effective. CPU is more expensive than memory/disk in the cloud environment, the total number of CPU vcore is constant in a given machine, for example, 96vcores, and only can allocate six 4xlarge(16vcore) type instances. Adding more memory or disk to a machine is easy to archive.

In order to reduce the cost of the TiDB cluster on the cloud, we should reduce the CPU core requirement for TiKV at first. There are too many thread pools and other threads in TiKV, too many thread pools and threads will cause bad performance if there are only 8 vcores.

Category

Cost-Effective, Performance

Value

Reduce cost on cloud/on-per.

Task List

  • Reduce overhead of the regular threads
  • Reduce split cost
  • Reduce scheduler cost
  • Reduce the cost of gc worker
  • Reduce thread pools
    • Combine scheduler pool to unified thread pools
    • [TBD]Combine apply pool and raftstore pool
  • Reduce other threads

Workload Estimation

200

Time

GanttProgress: 10%
GanttStart: 2020-08-01
GanttDue: 2020-11-30

Activity

  1. added this to the v5.0-alpha milestone on Jun 15, 2020
  2. iamxy commented on Jun 29, 2020

    @iamxy
    Member

    For general users AWS i3.2xlarge as the starting instance to deploy TiDB, the cost is still high. The public cloud recommends 8 GiB of memory per vCPU as the best specification for running a database. If we can make 4vCPU and 32GB memory as the baseline hardware requirements for TiKV node, this will be significant for users.

    Another ideal suggestion is to use EBS storage instead of the local disk by default. This is not because EBS is cheaper than local disks, but opposite the high provisioned IOPS EBS may be more expensive. But it can bring more flexibility and reliability, which allows users to have more instance types to choose, and the user's data will have more redundancy, thereby enhancing the system's fault tolerance. More importantly, the use of EBS is a necessary condition for elastic scheduling, because the node can be scaled vertically without transmitting data.

    The following is a list containing recommended instance types (for TiKV nodes)
    AWS

    • i3.xlarge, 4 vCPU, 30.5 GiB Memory, 1 x 950 NVMe SSD, $0.312 per Hour
    • i3en.xlarge, 4 vCPU, 32 GiB Memory, 1 x 2500 NVMe SSD, $0.452 per Hour
    • r5n.xlarge, 4 vCPU, 32 GiB Memory, EBS-Only, $0.298 per Hour

    GCP

    • n1-highmem-4, 4 vCPU, 26 GiB Memory, N x 375 GiB NVMe SSD, $0.2368 per Hour
  3. changed the title [-]Performance is good enough on AWS i3.2xlarge[/-] [+]Performance is good enough on AWS i3.xlarge/i3.2xlarge[/+] on Jun 30, 2020
  4. changed the title [-]Performance is good enough on AWS i3.xlarge/i3.2xlarge[/-] [+]Optimize the performance and stability of TiDB running on AWS i3.xlarge/i3.2xlarge[/+] on Jul 16, 2020
  5. iamxy commented on Jul 29, 2020

    @iamxy
    Member

    From cost considerations, it is recommended that we focus on supporting Amazon EBS gp2 volumes
    See: https://aws.amazon.com/ebs/volume-types/

    and Standard provisioned Persistent Disk for Google Cloud
    See: https://cloud.google.com/compute/docs/disks

  6. zhangjinpeng87 commented on Jul 30, 2020

    @zhangjinpeng87
    Contributor

    From cost considerations, it is recommended that we focus on supporting Amazon EBS gp2 volumes
    See: https://aws.amazon.com/ebs/volume-types/

    and Standard provisioned Persistent Disk for Google Cloud
    See: https://cloud.google.com/compute/docs/disks

    @iamxy I think you are talking about this issue #18024

  7. iamxy commented on Jul 30, 2020

    @iamxy
    Member

    Yes, thank you for linking.

  8. modified the milestones: v5.0.0-beta.1, v5.0.0-rc on Jan 7, 2021
  9. modified the milestones: v5.0.0-rc, v5.0.0 on Jan 18, 2021
  10. deleted a comment from Connor1996 on Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature/acceptedThis feature request is accepted by product managerspriority/P0The issue has P0 priority.type/feature-requestCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions