This topic describes how to test the performance of an ApsaraDB for MongoDB instance.

Procedure

  1. Add the primary private IP address of the ECS instance to a whitelist of the ApsaraDB for MongoDB instance. For more information, see Configure a whitelist or an ECS security group for an ApsaraDB for MongoDB instance.
    Note You can log on to the ECS console and view the Primary Private IP Address of the ECS instance in the Network Information section of the Instance Details page.
  2. Connect to the ECS instance. For more information, see Create and manage an ECS instance by using the ECS console (express version).
  3. Use the Yahoo Cloud Serving Benchmark (YCSB) tool to load test data.
    ./bin/ycsb load mongodb -s -p workload=site.ycsb.workloads.CoreWorkload -p recordcount=1000000 -p mongodb.url="mongodb://test:****@dds-bp13e84d11****.mongodb.rds.aliyuncs.com:3717/admin" -threads 8
    You can modify the following items:
    • recordcount=1000000: the total number of data records loaded to instance.
    • mongodb.url="mongodb://test:****@dds-bp13e84d11****.mongodb.rds.aliyuncs.com:3717/admin": the endpoint of the instance. The database account is test and the database is admin.
      Note You can obtain the endpoint in the Internal Connections - VPC section of the Database Connections page in the ApsaraDB for MongoDB console.
    • threads 8: the number of concurrent threads on the client.
  4. Run the following command to perform performance stress testing:
    ./bin/ycsb run mongodb -s -p workload=site.ycsb.workloads.CoreWorkload -p recordcount=1000000 -p operationcount=5000000 -p insertproportion=0 -p readproportion=50 -p updateproportion=50 -p requestdistribution=zipfian -p mongodb.url="mongodb://test:****@dds-bp13e84d11****.mongodb.rds.aliyuncs.com:3717/admin" -threads 8
    You can modify the following items:
    • recordcount=1000000: the total number of data records loaded to instance.
    • operationcount=5000000: the total number of read and write operations.
    • insertproportion=0: the ratio of load operations.
    • readproportion=50: the ratio of read operations.
    • updateproportion=50: the ratio of update operations.
    • mongodb.url="mongodb://test:****@dds-bp13e84d11****.mongodb.rds.aliyuncs.com:3717/admin": the endpoint of the instance. The database account is test and the database is admin.
      Note You can obtain the endpoint in the Internal Connections - VPC section of the Database Connections page in the ApsaraDB for MongoDB console.
    • threads 8: the number of concurrent threads on the client.