razorext2's avatar

laravel octane is VERY SLOW compared to nginx 1.27 from laragon.

Previously, I was not satisfied with the performance of my application running on Nginx version 1.27 in Laragon. Then, I tried using Laravel Octane with FrankenPHP as the chosen server.

I configured Laravel Octane in WSL2, which was then forwarded to Windows, and it successfully ran.

The problem is, I noticed a significant difference in performance. I tested the network load in Chrome DevTools and got the following results:

  • Nginx + PHP 8.3 TS = Load time 116ms - 145ms
  • WSL2 + Octane FrankenPHP = Load time 211ms - 368ms

As you can see, the load time difference is quite large—almost twice as slow or even worse!

Then, I tried a benchmark test using the /status endpoint (my application's health route) with the following parameters:

wrk -t2 -c50 -d30s https://domain.com/status
wrk -t2 -c50 -d30s https://domain2.com/status

I ran the benchmark three times for more accurate results, and the outcome was even worse. Octane achieved around 140 RPS - 233 RPS, while Nginx achieved 529 RPS - 798 RPS.

What is the issue?

I'm running the same application with the same configuration.
The only difference is that I used proxy_pass to Nginx when running Octane, following the Laravel Octane documentation.

Any idea why this is happening?

0 likes
2 replies
Tray2's avatar

Laragon is for development, not for running production sites. To do that you need to set up a proper production environment. This is usually done using a linux server, and not by using WSL2.

If I were you, I'd start with installing the laravel debugbar in the application, and take a look to see if there are any slow queries, n+1 issues, high memory usage, or too many hydrated models.

1 like

Please or to participate in this conversation.