mirror of
https://github.com/halfwaystudent/douyin-sparkflow.git
synced 2026-09-06 16:07:22 +08:00
perf: cap login desktop below one CPU
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ SPARKFLOW_SESSION_COOKIE_SECURE=0
|
|||||||
LOGIN_DESKTOP_BIND_ADDRESS=127.0.0.1
|
LOGIN_DESKTOP_BIND_ADDRESS=127.0.0.1
|
||||||
LOGIN_DESKTOP_WEB_PORT=8788
|
LOGIN_DESKTOP_WEB_PORT=8788
|
||||||
LOGIN_DESKTOP_PUBLIC_URL=/login-desktop/proxy/vnc.html?autoconnect=1&resize=scale&view_only=0&path=login-desktop/proxy/websockify
|
LOGIN_DESKTOP_PUBLIC_URL=/login-desktop/proxy/vnc.html?autoconnect=1&resize=scale&view_only=0&path=login-desktop/proxy/websockify
|
||||||
LOGIN_DESKTOP_CPUS=1.0
|
LOGIN_DESKTOP_CPUS=0.8
|
||||||
LOGIN_DESKTOP_MEMORY_LIMIT=1200m
|
LOGIN_DESKTOP_MEMORY_LIMIT=1200m
|
||||||
LOGIN_DESKTOP_PIDS_LIMIT=256
|
LOGIN_DESKTOP_PIDS_LIMIT=256
|
||||||
LOGIN_DESKTOP_IDLE_TIMEOUT_SECONDS=1800
|
LOGIN_DESKTOP_IDLE_TIMEOUT_SECONDS=1800
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class DeploymentContractTests(unittest.TestCase):
|
|||||||
compose = (REPO_ROOT / "docker-compose.yml").read_text(encoding="utf-8")
|
compose = (REPO_ROOT / "docker-compose.yml").read_text(encoding="utf-8")
|
||||||
start_script = (SOURCE_ROOT / "scripts" / "start_login_desktop.sh").read_text(encoding="utf-8")
|
start_script = (SOURCE_ROOT / "scripts" / "start_login_desktop.sh").read_text(encoding="utf-8")
|
||||||
server = (SOURCE_ROOT / "login_desktop_server.py").read_text(encoding="utf-8")
|
server = (SOURCE_ROOT / "login_desktop_server.py").read_text(encoding="utf-8")
|
||||||
self.assertIn("cpus: ${LOGIN_DESKTOP_CPUS:-1.0}", compose)
|
self.assertIn("cpus: ${LOGIN_DESKTOP_CPUS:-0.8}", compose)
|
||||||
self.assertIn("mem_limit: ${LOGIN_DESKTOP_MEMORY_LIMIT:-1200m}", compose)
|
self.assertIn("mem_limit: ${LOGIN_DESKTOP_MEMORY_LIMIT:-1200m}", compose)
|
||||||
self.assertIn("pids_limit: ${LOGIN_DESKTOP_PIDS_LIMIT:-256}", compose)
|
self.assertIn("pids_limit: ${LOGIN_DESKTOP_PIDS_LIMIT:-256}", compose)
|
||||||
self.assertIn("-nap -wait 50 -defer 50", start_script)
|
self.assertIn("-nap -wait 50 -defer 50", start_script)
|
||||||
|
|||||||
+1
-1
@@ -87,7 +87,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "${LOGIN_DESKTOP_BIND_ADDRESS:-127.0.0.1}:${LOGIN_DESKTOP_WEB_PORT:-8788}:6080"
|
- "${LOGIN_DESKTOP_BIND_ADDRESS:-127.0.0.1}:${LOGIN_DESKTOP_WEB_PORT:-8788}:6080"
|
||||||
command: bash /app/scripts/start_login_desktop.sh
|
command: bash /app/scripts/start_login_desktop.sh
|
||||||
cpus: ${LOGIN_DESKTOP_CPUS:-1.0}
|
cpus: ${LOGIN_DESKTOP_CPUS:-0.8}
|
||||||
mem_limit: ${LOGIN_DESKTOP_MEMORY_LIMIT:-1200m}
|
mem_limit: ${LOGIN_DESKTOP_MEMORY_LIMIT:-1200m}
|
||||||
pids_limit: ${LOGIN_DESKTOP_PIDS_LIMIT:-256}
|
pids_limit: ${LOGIN_DESKTOP_PIDS_LIMIT:-256}
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user