Testing the performance can be a bit tricky. But you can try using wrk. Its what Taylor used when he demoed it
A good way to check Octane?
I just installed Octane with RoadRunner. Looks like my app is being served correctly by it (using nginx)
Is there any good test I can do (simple preferably) to see if it really works well, or something to actually test its performance? (So that then I can compare it to "regular" app using just PHP-FPM)
Since it's quite new, I can't find too much information about it
@Sinnbeck O I remember that from when you helped me testing my Soketi server!
Since I run on a VM, will I have to match all following 3 with the same amount of workers?
- The VM - which is assigned 4 cores
- Octane - which I should then start using
php artisan octane:start --workers=4 - Finally wrk - start it with something like
wrk -t4 -c400 -d30s http://127.0.0.1:8000
@Ligonsker Play around with it a bit. I honestly cannot remember which values I uses when I was testing it myself, but I think that isnt far off :)
@sinnbeck I just made a few tests. Ran a few times with matching core number, 4 in my case (VM, Octane and wrk).
And then I ran a few tests with PHP-FPM alone, and from some reason, the req/sec is on average quite higher than the one with Octane.
I am using a clean Laravel project and hitting the Laravel welcome page.
This is the best result when using Octane:
user@server:~$ wrk -t4 -c400 -d30s http://127.0.0.1/
Running 30s test @ http://127.0.0.1/
4 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 887.53ms 299.89ms 1.53s 61.66%
Req/Sec 138.80 134.46 782.00 86.98%
13340 requests in 30.04s, 238.36MB read
Requests/sec: 444.09
Transfer/sec: 7.94MB
And this is the best result when using PHP-FPM alone:
user@server:~$ wrk -t4 -c400 -d30s http://127.0.0.1/
Running 30s test @ http://127.0.0.1/
4 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 723.95ms 83.16ms 1.04s 81.75%
Req/Sec 143.19 99.21 525.00 67.24%
16381 requests in 30.10s, 293.92MB read
Requests/sec: 544.13
Transfer/sec: 9.76MB
I posted the best results, but PHP-FPM was always higher anyway (Averaging ~480 req/sec, as opposed to ~400 req/sec with Octane)
Just for comparison, this is the result I got when using the built-in Laravel server:
user@server:~$ wrk -t4 -c400 -d30s http://127.0.0.1:8080/
Running 30s test @ http://127.0.0.1:8080/
4 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 767.54ms 626.07ms 1.78s 79.41%
Req/Sec 44.60 45.79 257.00 87.16%
2075 requests in 30.04s, 37.04MB read
Socket errors: connect 0, read 2075, write 0, timeout 1973
Requests/sec: 69.08
Transfer/sec: 1.23M
I wonder what could be wrong, or it's just not a good test for Octane when doing it on a simple static page, and these results are simply because of other factors such as the host being busy at this time or other things
@Ligonsker I tested mine on a simple blade endpoint. But I didnt run it trough nginx. I just opened the port directly in the docker container and connected to it.
@Sinnbeck Did you see an improvement when using Octane on the simple static page as opposed to what I get now?
@Ligonsker yeah a bit. Maybe 2-3 times faster. But I didn't spend much time on it as I didn't need it in production. Nginx handles that with no problems at all
@Sinnbeck What! 2-3 times :o, so perhaps in my case, because I use nginx, I did not even get to the point where I see gains with Octane? Or I am doing something wrong somewhere?
@Ligonsker Thats a good question. I set up 2 identical projects in docker on a linux machine. If you have windows in the mix that might make a difference. But that being set, I have never been able to get it to run as fast as Taylors demo at laracon
@Sinnbeck You have the link to the part where he test it on Laracon? I wanna see what he's doing there
Please or to participate in this conversation.