Havoc
3 months ago
Tbh I feel this in one of those that would be significantly cleaner without serverless in first place.
Sticking something with 2 second lifespan on disk to shoehorn it into aws serverless paradigm created problems and cost out of thin air here
Good solution moving at least partially to a in memory solution though
tcdent
3 months ago
Yeah, so now you're basically running a heavy instance in order to get the network throughput and the RAM, but not really using that much CPU when you could probably handle the encode with the available headroom. Although the article lists TLS handshakes as being a significant source of CPU usage, I must be missing something because I don't see how that is anywhere near the top of the constraints of a system like this.
Regardless, I enjoyed the article and I appreciate that people are still finding ways to build systems tailored to their workflows.
ahoka
3 months ago
TLS being a bottleneck when doing image processing is very-very weird.
mannyv
3 months ago
They should terminate TLS at the LB and use normal connection inside...unless they have some HIPAA privacy-like regulation going on.
inlined
3 months ago
Maybe they’re not using keepalives in their clients causing thousands of handshakes per second?
ruperthair
3 months ago
Yes, they mention this as a 'fix' for connection-related memory usage:
> Disable keep-alive: close the connection immediately after each upload completes.
Very odd idea.
elevation
3 months ago
The scalable in-memory solution took quite a bit of testing to get right. Building this on the early side of the business when the requirements are not well known can be a giant budget and time tar pit. Plus without customers it’s hard to confidently test at scale.
Using S3 for an MVP and marking this component as “done” seems like the right solution, regardless of the serverless paradigm.
halJordan
3 months ago
Agreed, but the first design principle is "eliminate complexity at the design level." MVPs and what they represent (a failure to design) are an albatross