mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
[Feature] Add Golang-based Router for Request Scheduling and Load Balancing (#5882)
* [Feature] add golang router * [Feature] add golang router * [Feature] add golang router * [Feature] add golang router * [Feature] add golang router * [Feature] Add Golang-based Router for Request Scheduling and Load Balancing * [Feature] Add Golang-based Router for Request Scheduling and Load Balancing * [Feature] Add Golang-based Router for Request Scheduling and Load Balancing * [Feature] Add Golang-based Router for Request Scheduling and Load Balancing --------- Co-authored-by: mouxin <mouxin@baidu.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
PID=$(ps -ef | grep "fd-router" | grep -v grep | awk '{print $2}')
|
||||
if [ -n "$PID" ]; then
|
||||
echo "Killing existing fd-router process (PID: $PID)"
|
||||
# Try graceful shutdown first
|
||||
kill -15 $PID
|
||||
TIMEOUT=10
|
||||
while kill -0 $PID 2>/dev/null && [ $TIMEOUT -gt 0 ]; do
|
||||
echo "Waiting for fd-router (PID: $PID) to exit gracefully... ($TIMEOUT seconds remaining)"
|
||||
sleep 1
|
||||
TIMEOUT=$((TIMEOUT - 1))
|
||||
done
|
||||
# Force kill if still running after timeout
|
||||
if kill -0 $PID 2>/dev/null; then
|
||||
echo "fd-router (PID: $PID) did not exit gracefully; sending SIGKILL..."
|
||||
kill -9 $PID
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Starting new fd-router process..."
|
||||
nohup ./fd-router --config_path ./config/config.yaml --splitwise > fd-router.log 2>&1 &
|
||||
echo "fd-router started with PID: $!"
|
||||
Reference in New Issue
Block a user