Skip to content

Commit

Permalink
[sysadmin] multiple workers for fastapi backends
Browse files Browse the repository at this point in the history
  • Loading branch information
kidanger committed Feb 17, 2024
1 parent e9aa6f9 commit 45f16f7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sysadmin/systemd/core/ipol-core.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Run core
After=network.target

[Service]
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn app:app --host 0.0.0.0 --port 8080"
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn app:app --host 0.0.0.0 --port 8080 --workers 20"
WorkingDirectory=/home/ipol/ipolDevel/ipol_demo/modules/core/
Environment=IPOL_HOST=ipolcore.ipol.im
Environment=IPOL_URL=https://ipolcore.ipol.im
Expand Down
2 changes: 1 addition & 1 deletion sysadmin/systemd/core/ipol-demorunner.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Run demorunner
After=network.target

[Service]
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn demorunner:app --host 0.0.0.0 --port 9004"
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn demorunner:app --host 0.0.0.0 --port 9004 --workers 10"
WorkingDirectory=/home/ipol/ipolDevel/ipol_demo/modules/demorunner/
Environment=IPOL_HOST=ipolcore.ipol.im
Environment=IPOL_URL=https://ipolcore.ipol.im
Expand Down
2 changes: 1 addition & 1 deletion sysadmin/systemd/green/ipol-demorunner.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Run demorunner
After=network.target

[Service]
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn demorunner:app --host 0.0.0.0 --port 9004"
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn demorunner:app --host 0.0.0.0 --port 9004 --workers 10"
WorkingDirectory=/home/ipol/ipolDevel/ipol_demo/modules/demorunner/
Environment=IPOL_HOST=ipolcore.ipol.im
Environment=IPOL_URL=https://ipolcore.ipol.im
Expand Down
2 changes: 1 addition & 1 deletion sysadmin/systemd/integration/ipol-core.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Run core
After=network.target

[Service]
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn app:app --host 127.0.0.1 --port 10080"
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn app:app --host 127.0.0.1 --port 10080 --workers 8"
WorkingDirectory=/home/integration/ipolDevel/ipol_demo/modules/core/
Environment=IPOL_HOST=integration.ipol.im
Environment=IPOL_URL=https://integration.ipol.im
Expand Down
2 changes: 1 addition & 1 deletion sysadmin/systemd/integration/ipol-demorunner.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Run demorunner
After=network.target

[Service]
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn demorunner:app --host 127.0.0.1 --port 10004"
ExecStart=/bin/bash -c "source ./venv/bin/activate && uvicorn demorunner:app --host 127.0.0.1 --port 10004 --workers 6"
WorkingDirectory=/home/integration/ipolDevel/ipol_demo/modules/demorunner/
Environment=IPOL_HOST=integration.ipol.im
Environment=IPOL_URL=https://integration.ipol.im
Expand Down

0 comments on commit 45f16f7

Please sign in to comment.