Serverless Messaging: Latency Compared
This is really interesting info.
If nothing I’ve learned the meanings behind the Pxx values. For whatever reason I’ve stared at those numbers for years knowing, but not actually knowing what they actually represent. This has one of the best explanations I’ve ever read.
Slightly embarrassing but at least I know that (for at least one more day) the grey matter still works. ![]()
Really good read!
Nice one.
The explanation was a little simplistic/misleading , it’s best to just think of it like p99 means “99% of the items were below this value” .
Really nice. Is it possible to add vpc endpoints to these services and interact through them? Would be cool to see how much latency drops when hoping through the internet!
There is an inaccuracy here, may be small, but certainly notable. For the kinesis consumer, we can easily figure out your approx p50 by the fact that the consumer poll period is once per second for the default implementation of lambda consumer provided by AWS. Because of this, your expected p50 should be just over 500ms, which is what we see. The configuration of the batch doesn’t do anything wrt poll period, it just means that once the event source mapping has it (which means after it has performed a poll operation), it will provide that one record to the lambda function and not perform any additional batching. To the p90 value, note that the lambda operation is a sync operation, so a cold start (which I noticed was excluded from the data) would result in the proceeding lambda immediately after also being delayed by probably an average of a second depending on the average cold start time.
If you wanted to use kinesis and reduce the time, you can use your own consumer via the KCL and get much faster response times, however note that kinesis has a max number of 5 reads per second, which means an optimally configured stream cannot get beyond a p50 of just over 100ms. However, as this correctly identifies, this is where EFO comes in. One minor correction, EFO is a single consumer application, that is, it cannot serve multiple consumers via EFO. You would have to create a new EFO app for each consumer, fortunately that is pretty easy but is a direct multiplier on cost. 1 EFO consumer apps doubles the underlying cost of the stream.
For some reason I expected pushh-based to outperform pull-based, especially in the case of SNS. But it’s nice to see that the “default” option is also the fastest