Closed RicardoSette closed 3 years ago
Thanks for your advice, I was thinking that I just need to provide some components with swoole, you can odify by yourself. But on this issue, I think I should provide a default options for users. I'll changed soon.
Thanks for your good idea! It already has been done.
Before I start, congratulations on the beautiful job of integrating Yii2 with Swoole.
When executing the step by step I found errors, simple to be corrected, but that can generate discomfort in those who are trying to test Swoole with Yii2.
In the server.php file we have:
but the recommendation thing for a basic application with swoole would be:
and file swoole.php is:
This is because the default in web.php uses yii\web\Response, yii\web\Request and yii\web\ErrorHandler, making it incompatible with Swoole way of working.
Benchmark on the machine comparing Yii2 with Swoole and Yii2 with PHP-FPM, both below NGINX:
example NGINX file:
As the test machine is a virtual machine, see that PHP-FPM answered several requests with timeout, so I lowered the number of connections from 100 to 10, see now:
So what we have:
+- 400 requests in 10 seconds for 12000 requests or +- 40 req/s to 1200 req/s
With that we can say that Swoole is the great solution for PHP to fight Go and Node