Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AgustinR's avatar

Vapor performance

Hi, i'm evaluating Vapor before moving our biggest project to serverless. I'm triying to get some numbers comparing our current setup vs a serverless one.

Performance is not looking great. With a clean laravel 7 installation, on a url with no middlewares (or session), a simple return 'ok':

And with 2048mb i got this:

And all of that is without touching sessions or db. If i add a query to return the first user and json encode it, i get a large latency increase (i checked the db is on the same region).

What it's weirder, in one ocassion after few hours without deploying, i saw a constant processing time of 10 ms, i cannot explain how is that possible. I tried running some ab during few minutes to see if it's related to warming without results.

A aws panel screenshot that shows the expected performance on a random ocassion:

Is this expected performance? I'm all in on serverless, but i value single request performance more than anything else.

0 likes
6 replies
AgustinR's avatar

The only reference I found to performance was this from the laravel vapor presentation:

12ms it what I’m expecting with 2048mb

AgustinR's avatar

And here it is, after the whole night without deploying, one of the test deployments:

On cloudwatch logs:

REPORT RequestId: c7a9177c-c060-4639-8e59-a3cf21d82190 Duration: 6.88 ms Billed Duration: 100 ms Memory Size: 2048 MB Max Memory Used: 168 MB

As soon as i deploy, i will lose this performance for a few hours.

The other one, after no deployings on the whole night:

REPORT RequestId: 382d34d3-b5ed-408c-a8a4-27ae45866af2 Duration: 93.65 ms Billed Duration: 100 ms Memory Size: 2048 MB Max Memory Used: 145 MB

AgustinR's avatar

For anyone reading this, after 5 days testing, i give up. I'll try again in the future where the platform is more mature.

The performance is inconsistent, i tried tracing the app adding some timers on the boostrap/app.php (the first thing loaded), it shows 25 ms ellapsed and this is just the pre-setup of the framework.

Sometimes works well and do the whole response in 5 ms. I think it's something related to autoloading, but who knows.

I'm pretty sure this is happening to more people and paying a lot of extra computation time because this bug.

monsterdream's avatar

Hi @agustinr , I would like to confirm your issue because I have that same since the beginning of playing with Vapor. I was expecting better performance and my surprise was when simple DigitalOcean for 10$ was much faster than my Vapor setup and still, application is very simple and it has no reason for being slow, but in Vapor it is.

Still looking for solution from time to time but haven't found anything so far.

alt text

1 like
eresources's avatar

I've built an entire site around serverless Vapor and while I'm very happy with the overall workflow and scalability, the site is very, very slow compared to my traditional server sites. The main issue for me is that AWS is just slow in general. S3 can be horribly slow even behind cloudfront and cloudflare when the cache gets busted, and the latency even for your serverless cache is significantly longer than just running everthing from a local DB on a traditional server. AWS infrastructure is more to blame than Vapor itself, as I've found the lambda response times, cache response times and DB response times are what drive up the wait on my site. It all combines to something usable, but barely.

AgustinR's avatar

Latency issues doesn't makes sense if you don't even hit db or cache. Also, something must be wrong if sometimes you get great performance and sometimes bad, without any changes.

Maybe it's aws fault and a premature thing to adopt right now, but currently isn't what have been promised, and support didn't seem to be interested in investigating it.

2 likes

Please or to participate in this conversation.