Hi,
I'm developing an API with Lumen for a Laravel app. The API will be required to support ~200,000 requests per minute in production.
Taylor benchmarked 1800 requests per second for vanilla lumen on his laptop. On my laptop I run ~900/second for the Lumen welcome() page (though with eloquent and facades enabled, as well as a config file, a middleware and a service provider).
However, when I run the API route that will be called 200,000 times a minute, I get only about 550/second. A bit of testing showed that as soon as I uncommented all calls to the Cache facade, speed went back up to ~750/second. I suppose the other ~200 are lost through the overhead of middleware and eloquent.
But how come loading Cache takes away that much? Multiple calls to Cache don't make a big difference, since Redis (which is what I use) is obviously a lot faster than a few hundred calls per second.
I did not do any performance optimizations on Redis or Postgres or Nginx (those three are in use, though no database is being hit during that crucial route), though I did try whether enabling opcache made a difference (didn't).
Any idea whether there is a way to reduce that overhead of the Cache facade?
Also, would one win a lot of requests/second with eloquent & facades disabled, and all DB-interaction / Cache interaction done manually?
Thanks for any opinions!
Edit: requests/second were measured with apache-benchmark