0

Our application in production is having frequent outage because it is not able to bear load. Now, the api is login api which is very critical one. inside login api we have 3 rest calls and 8 dynamodb calls (6 read calls and 2 write call - item size is always less than 1 kb and we are looking for eventual consistency). microservice is running on embedded tomcat(7), we are using spring boot. as I read from tomcat documentation it has by default 200 threads and my 1 request is taking around 800ms to complete. So, could you please help me what configuration should I put to dynamodb RCU & WCU? Is it worth to have DAX for read calls and how simple it is to integrate it with existing application. We have 2 instances running in production for the microservces, for some reason if we can find out what configuration shoud be appropriate then we can go with increasing instances, also how much increase should we do for RCU and WCU ? Please guide.

Rahul Singh
  • 781
  • 11
  • 27
  • the tps I am looking for is 160 – Rahul Singh Aug 05 '19 at 02:38
  • Why not switch to [pay per request billing](https://aws.amazon.com/blogs/aws/amazon-dynamodb-on-demand-no-capacity-planning-and-pay-per-request-pricing/) introduced at re:Invent 2018? – madhead Aug 05 '19 at 09:42

1 Answers1

0

If it is important for you to keep using DynamoDB's provisioned billing mode, then you should configure it by 2 standards:

1) Your "base" RCU/WCU should be your average monthly usage, you can easily see this in the dashboards AWS provides, check for Consumed RCU/RCU

2) You can also configure the auto scaling, this should be based both on your spike usage and the max your company is willing to spend monthly on DynamoDB, again this is easily extracted from the dashboards

But if you can use the on-demand billing mode as mentioned by @madhead, it will take care of spikes automatically for you, since you're not actually provisioning anything.

Be aware though! On-demand mode charges you for each request, it is very cheap if you have uneven and spiky usage, but if you have a constant and preditable access, it will definitely be more expensive than the provisioned mode.

Mojimi
  • 2,561
  • 9
  • 52
  • 116
  • Ok...I have in general one query for aws free tier for dynamodb they have mentioned like "25 Units of Read Capacity and 25 Units of Write Capacity, enough to handle up to 200M requests per month ", could you please let me know how it is possible?? – Rahul Singh Aug 10 '19 at 13:22
  • There are 2 million seconds in a month, times 25 is 64 million. A small query takes 1/4 of a RCU so that gives 200 million requests in a perfectly ideal scenario – Mojimi Aug 10 '19 at 13:36
  • Okay got it thanks.....can you please let me know if I need to check how much time query is taking then how can I check, is any metrics provided by aws or I need to put start/stop time in dao layer to determine this?? – Rahul Singh Aug 10 '19 at 17:18
  • It's not about time but how much RCU your query costs, there's an option in the API that returns the value, you'll have to check how to do that in the SDK you're using, or just check the metrics at the AWS console of your dynamodb table – Mojimi Aug 10 '19 at 17:22
  • Ohh, I have checked using calculator provided by aws I have 1rcu unit consumed full i.e 4kb for 1 rcu. I think 4kb is too big right?? What I want to know is if for x size of item for strongly consistent how much rcu per second can be supported or a way to find out. Because that way only I can take out time taken by full transaction and all im between time taken by resources.I know through cloud watch I can find out but nit at that precise level that I am asking.Pleasee know if this seems right approach. – Rahul Singh Aug 10 '19 at 17:29
  • Any more over if I am reading 4 items of 1kb per second then it will.be considered as 1 rcu right? – Rahul Singh Aug 10 '19 at 17:58
  • https://acloud.guru/forums/aws-certified-developer-associate/discussion/-KvFDbwj7qK8yoPmJaWe/Clarification%20on%20DynamoDB%20Free%20Tier%20Usage – Rahul Singh Aug 11 '19 at 04:38