简体   繁体   English

本地运行的DynamoDb的默认预配置吞吐量(读写容量单位)是多少?

[英]What is the default Provisioned Throughput(read and write capacity unit) for locally running DynamoDb?

I'm new to DynamoDb and trying to do bulk insert of around 5.5k items on my locally running DynamoDb using Java. 我是DynamoDb的新手,并尝试使用Java在本地运行的DynamoDb上批量插入约5.5k项。 Despite my best efforts, and various tweakings, I am able to do this in around 100 seconds(even after using executor framework). 尽管我已经尽了最大的努力和各种调整,但我仍然能够在大约100秒内完成此操作(即使在使用了executor框架之后)。

I posted my code here , but didn't get an answer. 我在这里发布了代码,但没有得到答案。

To improve the insertion rate I tried changing the Provisioned Throughput value several times while creating the table, then I got to know that when running locally, dynamodb ignores the throughput values. 为了提高插入率,我尝试在创建表时多次更改Provisioned Throughput值,然后才知道在本地运行时,dynamodb会忽略吞吐量值。 So I think its my dynamodb that is not able to handle so many write requests at a time and when I do it on the AWS server, the performance might improve. 因此,我认为它的动力无法一次处理这么多的写入请求,而当我在AWS服务器上进行处理时,性能可能会提高。

This is the code I was running to create table: 这是我用来创建表的代码:

    public static void main(String[] args) throws Exception {
        AmazonDynamoDBClient client = new AmazonDynamoDBClient().withEndpoint("http://localhost:8000");

        DynamoDB dynamoDB = new DynamoDB(client);
        String tableName = "Database";
        try {
            System.out.println("Creating the table, wait...");
            Table table = dynamoDB.createTable(tableName, Arrays.asList(new KeySchemaElement("Type", KeyType.HASH),
                    new KeySchemaElement("ID", KeyType.RANGE)

            ), Arrays.asList(new AttributeDefinition("Type", ScalarAttributeType.S),
                    new AttributeDefinition("ID", ScalarAttributeType.S)),
                    new ProvisionedThroughput(10000L, 10000L));
            table.waitForActive();
            System.out.println("Table created successfully.  Status: " + table.getDescription().getTableStatus());

        } catch (Exception e) {
            System.err.println("Cannot create the table: ");
            System.err.println(e.getMessage());
        }
    }

But to be sure I want to know what's the default read and write capacity unit of a locally running dynamodb instance? 但是,请确保我想知道本地运行的dynamodb实例的默认读写容量单位是什么?

DynamoDBLocal does not implement the throughput limitations in any way. DynamoDBLocal不会以任何方式实现吞吐量限制。 If your throughput is limited, it is limited by the hardware you are running it on. 如果吞吐量受限制,则受运行硬件的限制。

From the DynamoDB Local docs : DynamoDB Local文档中

The speed of read and write operations on table data is limited only by the speed of your computer. 对表数据进行读写操作的速度仅受计算机速度的限制。

According to this answer to a related question, the performance is noticeably poor because DynamoDB local uses SQLite behind the scenes. 根据这个答案到一个相关的问题,表现明显较差,因为DynamoDB本地使用SQLite幕后。 Since the implementation is different than the real DynamoDB, we should expect that the performance will be different as well. 由于实现与真正的DynamoDB不同,因此我们应该期望性能也会有所不同。

If you need to do any performance testing with DynamoDB, you should use the real DynamoDB. 如果需要使用DynamoDB进行任何性能测试,则应使用真正的DynamoDB。 My company has used DynamoDB for applications with tens of thousands of reads and writes per second without any scaling problems from DynamoDB, so I can attest that the real DynamoDB will perform much better than DynamoDB Local. 我的公司已将DynamoDB用于每秒读取和写入数以万计的应用程序,而DynamoDB没有任何扩展问题,因此我可以证明,真正的DynamoDB的性能将比DynamoDB Local更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM