Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 22.x
Latest version:
pecl install openswoole-22.1.2
<?php Swoole\Server->set(array $settings)
Check the full list of Swoole server configurations that can be used with this method
if success, it returns TRUE, otherwise it returns FALSE.
Set the runtime settings of the Swoole server. Settings can be accessed by $server->setting
when the Swoole server has started.
You can only use this method before the server has started, cannot be used before the call to $server->start()
.
<?php
$server->set([
'reactor_num' => 2,
'worker_num' => 4,
'backlog' => 128,
'max_request' => 50,
'dispatch_mode' => 1,
]);
Checkout the full list and documentation for each server configuration. These options can be set using this method.