平滑重启_swoole服务平滑重启
程序员文章站
2024-01-19 09:16:58
...
给swoole进程定义别名
$server = new SwooleWebSocketServer("0.0.0.0", 9501);
$server->on('start', function (SwooleWebSocketServer $server) {
swoole_set_process_name("swoole_websocket_server");
});
reload.sh脚本
echo "loading..."
pid="pidof swoole_websocket_server"
echo $pid
kill -USR1 $pid
echo "loading success"
linux中执行
sh reload.sh