0
votes

I am building webservice integration in AWS lambda (Java) to perform financial transactions.

This application will get around 5 transactions/sec and response time is expected to be around 500 milliseconds.

Currently the response time varies from 2 seconds to 8 seconds.

Same code in Springboot application with embedded tomcat gives a response time of around 500 milliseconds

I have tried increasing memory for AWS Lambda function but still cant achieve 500 milliseconds response

My questions are as follows

  1. Is AWS Lambda ideal for financial transaction with quick response time (i.e. 500 millisecs) ?
  2. What type of application is AWS Lambda suitable for ?
1
"ideal" is probably a dedicated circuit implementing your logic in hardware. - daniu
@daniu this is a valid question and concern to anyone working with containers and/or Serverless. - Panagiotis Kanavos
@Nilesh is 2 seconds the cold start time perhaps? What does your Lambda do? - Panagiotis Kanavos
@Nilesh you should probably check Yan Cui's blog series on AWS Lambda, eg I’m afraid you’re thinking about AWS Lambda cold starts all wrong and How does language, memory and package size affect cold starts of AWS Lambda?. Java and C# have longer cold start times - Panagiotis Kanavos
@PanagiotisKanavos Thanks for your response. 2 secs is time whn its warm. My lambda performs webservice calls. I will check links you have shared - Nilesh

1 Answers

0
votes

For cold start, Lambda functions spin up a virtual machine and execute within approximately 100 milliseconds of being called.For a user facing application 100 milliseconds for startup alone is too long. On the other hand, an EC2 server will stay up for as long as needed and accept connections for as long and as quickly as it is configured to do so.

Also in term of pricing a Lambda function with 512 MB of memory run for 1 hour (or, more likely, as several calls of the same function adding up to an hour of uptime) costs $0.030024, while an on-demand EC2 server with the same statistics (a t2.nano server with 0.5 GB of memory) costs $0.0059 per hour.So for your scenario lambda could cost you more.

An example of lambda use case would be suppose you have a repository that needs to be synchronized on a regular basis .Instead of keeping a dedicated instance up and running 24/7, you can use a Lambda function.