spring-cloud / spring-cloud-function

Apache License 2.0
1.04k stars 615 forks source link

aws Lambda slow start #254

Closed lramamoo closed 5 years ago

lramamoo commented 5 years ago

I am running a spring cloud function in aws lambda. But the startup time of the function is high around 15s.

When I increase the lambda memory size to 2000MB, function starts in max 4s.

Is there any way to reduce this cold start time?

dsyer commented 5 years ago

Use functional bean definitions. Increase the memory allocation (AWS gives you more CPU then). See here for more detail: https://spring.io/blog/2018/10/22/functional-bean-registrations-in-spring-cloud-function

olegz commented 5 years ago

I think we can close this given that Function Bean Definitions are pretty well covered in the user guide. Please let us know if you believe something is still missing