Reputation: 14655
I'm using Amazon Java SDK Client for DynamoDB and latency is about 100ms min and 256ms on average on GetItem for wide spread of keys. In cloudwatch it is about 8-10ms.
I've tried to start new AmazonDynamoDBClient for each thread with threadlocal hoping it is in some caches. I've tried to switch to STSSessionCredentialsProvider from BasicAWSCredentials hopping token security check is faster. But still I have same very high latency on both EC2 instance and office.
What can cause such latency on client?
Upvotes: 1
Views: 1851
Reputation: 7450
The 8-10ms latency in cloudwatch is the service side latency, that is the time it takes once your request reaches Amazon's servers. This does not include overall network latency as there is no way to measure this on the server-side.
The extra latency you are seeing is network latency between you and Amazon. When using EC2 and DynamoDB in the same region you should see ~1ms latency. You mentioned using EC2, are you sure your EC2 instance was in the same region as your DynamoDB table?
Upvotes: 2