3 ms·
This one's pretty important. I tried to implement slack commands using lambda. But because slack needs a first response within a tiny period of time, my command
by nstart 9y ago
This one's pretty important. I tried to implement slack commands using lambda. But because slack needs a first response within a tiny period of time, my command would often need to be run twice since the first attempt would timeout as lambda spun up the server.
- k__ 9y agoCan't you lower the latency of a cold start with less code?
- nstart 9y agoMaybe? All this code did was call another lambda function and return a 204.
- k__ 9y agoAh okay. I just watched a tutorial where someone described methods to make the cold starts faster and one major point was, get the code size down, because on a cold start the target machine needs to download the code and run it.
- StellarTabi 9y agoDepends on language, too. Python and nodejs's cold starts are close to 100ms, Java and C#'s can be more dangerous. I also assume that comparison was with minimal code samples with no dependencies.
- k__ 9y agoInteresting, didn't expect Java or C# runtime startup to be much of an issue after all these years.
- caiosba 9y agoOur solution to avoid that (and that we use here: https://github.com/meedan/check-bot https://github.com/meedan/check-bot) is to have a second lambda function. The first lambda function (called by Slack) uses AWS SDK to send a request to the second lambda function and replies right away. The second lambda function continues running in background and then uses Slack API to send the actual message.