GraphQL with the Serverless Framework
John McKim

We recently tried using Lambda for one of our web applications that gets light traffic (~3k visitors/day) but we concluded we had to ditch it because it wasn’t fast enough for our use case.

In our case, we attempted to use it server-side render an isomorphic react app for the end user, which granted is a different from what you’re discussing here.

Nevertheless, what we found was that — unless we were pinging lambda constantly (read: multiple times a minute) — it would take anywhere from 500ms to 3 seconds to serve a request. This is because lambda has to load our whole app into memory before it could render anything for the end user and that (understandably) was taking a while. That being said, if it had just recently served a request, there was a better chance it would still have the app in memory, not have to reload it, and thus serve the request in a reasonable amount of time. We did the math and figured that given our traffic this would only be an issue for ~3% of page loads but we still decided that was too much.

This was a little while ago (4 months or so at this point) and so the exact numbers I’m quoting here may be a bit off, but I’m curious:

What has the load time been like for this for both initial and subsequent requests?

It’s more than possible we were misunderstanding what was happening with lambda and so it’d be great to know if your experience corroborates this. Great article.

Show your support

Clapping shows how much you appreciated Peter Berg’s story.