By mike85
I’ve just started using Kubernetes. I have a Laravel Application running on a Basic Droplet 4vCPUs/8GB Memory. Doing a ApacheBench gives me ~160 requests/sec. Doing the same test on the same Laravel Application but running in Kubernetes on a 40vCPU/160GB Droplet, gives me only ~40 requests/sec. I’m using one DO LoadBalancer. Even if I only use one 4vCPUs/8GB Droplet I get ~35 requests/sec. I’ve checked the logs and the requests are being processed by all pods in use. Is it generally slower to run all requests through the load balancer -> ingress controller -> nginx -> php-fpm?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This is a really interesting but there are a lot of details to explore to get to the bottom of this.
The first thing I would note is that requests per second might not be the best metric to measure. You probably should measure average response time or, even better, P99 latency.
Also, do you know how ApacheBench is running its test? How many parallel requests is performs? One at a time? Something else?
Also, do you know the baseline processing time of your Laravel app? In other words, ignoring network time, how long does it take for your app to process a request? If your app is super fast, then even the smallest network slowness will significantly change your requests/sec: Compare (100ms network + 1ms processing) to (150ms network + 1ms processing).
That said, I think it’s reasonable that you will have some overhead if you use a Kubernetes cluster with a Load Balancer compared to an all-in-one droplet. You basically end up with something like:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.