You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ReactPHP HttpServer it is possible to provide the option so_reuseport to make the kernel load balance requests on the same port. Is there a way of doing this for Framework-X?
Example:
<?php// $ composer require react/http react/socket # install example using Composer// $ php example.php # run example on command line, requires no additional web serverrequire__DIR__ . '/../vendor/autoload.php';
$http = newReact\Http\HttpServer(function (Psr\Http\Message\ServerRequestInterface$request) {
returnReact\Http\Message\Response::json(
"Hello World!"
);
});
$socket = newReact\Socket\SocketServer('0.0.0.0:8080', [
'tcp' => array(
'so_reuseport' => true,
)
]);
$http->listen($socket);
This will allow you to start as many servers as you want, and all requests made to that port will be distributed efficiently
Current Solution:
I am using a load-balancer (e.g Nginx) and multiple Framework-X instances running on different ports, letting the load balancer handle it. This works well
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the ReactPHP HttpServer it is possible to provide the option
so_reuseport
to make the kernel load balance requests on the same port. Is there a way of doing this for Framework-X?Example:
This will allow you to start as many servers as you want, and all requests made to that port will be distributed efficiently
Current Solution:
I am using a load-balancer (e.g Nginx) and multiple Framework-X instances running on different ports, letting the load balancer handle it. This works well
Beta Was this translation helpful? Give feedback.
All reactions