Phalcon Micro + Swoole HTTP Server

Hi, I just create an environment that running Phalcon on top of Swoole. I have a script that I upload on Github Gist, here is my script: https://gist.github.com/maulanasatyaadi/552fbd54ff7e23b3b8ffb6adf1562a6f

I have to test with a heavy compute request, and the result has good enough. On AMD A9 dual-core processor with each 3.6GHz (turbo on), it can reach 3532 requests per second (Swoole HTTP) with 0 error, 5922 requests per second (Swoole on Unix socket + Nginx) with 0 error, and with Nginx + PHP-FPM it just reach 1385 requests per second. And of course, there is no memory leak, I have tested it too.

Here is my code using Nginx + PHP-FPM:

<?php
use Swoole\Http\Server;
use Phalcon\Mvc\Micro;
use Phalcon\Di\FactoryDefault;
// Load factory default dependencies
$di = new FactoryDefault();
// Load application based on dependency injection
$app = new Micro($di);
// Set response while path not found
$app->notFound(function() {
    return ['not found'];
});
// Set response for path '/'. This is default response (like index.php)
$app->get('/', function() {
    return ['Hello world!'];
});
echo json_encode(['message' => $app->handle()]);

My bottleneck is I don't know how to make an HTTP request adapter in Phalcon that maybe make this method better. I hope in the future someone makes an HTTP request adapter that supports the Swoole HTTP request interface.

edited 2d ago

you can try manaphp[https://github.com/manaphp/manaphp] framework ,it suports fpm and swoole coroutine.

you can try manaphp[https://github.com/manaphp/manaphp] framework ,it suports fpm and swoole coroutine.

But the documentation is Chinese. I can't read that.