From 166dd12db2b1133f2f00b6fa091d41f1a7672ca7 Mon Sep 17 00:00:00 2001 From: bhrg3se Date: Thu, 17 Sep 2020 11:50:21 +0545 Subject: [PATCH] ref :[server] nice value of guacenc and ffmpeg increased to 10 --- server/accessproxy/rdpproxy/store.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/accessproxy/rdpproxy/store.go b/server/accessproxy/rdpproxy/store.go index 8cad9ea6..53cb53bf 100644 --- a/server/accessproxy/rdpproxy/store.go +++ b/server/accessproxy/rdpproxy/store.go @@ -88,7 +88,7 @@ func (s GWStore) uploadSessionLog(authlog *logs.AuthLog) error { func getGuacencCmd(sessionID string) *exec.Cmd { if os.Getenv("GUACENC_INSTALLED") == "true" { guacencCmdStr := fmt.Sprintf( - "/usr/local/guacamole/bin/guacenc -f /tmp/trasa/accessproxy/guac/%s.guac", sessionID) + "nice -n 10 /usr/local/guacamole/bin/guacenc -f /tmp/trasa/accessproxy/guac/%s.guac", sessionID) return exec.Command("/bin/sh", "-c", guacencCmdStr) @@ -96,13 +96,13 @@ func getGuacencCmd(sessionID string) *exec.Cmd { if runtime.GOOS == "windows" { guacencCmdStr := fmt.Sprintf( - "docker.exe exec guacd /usr/local/guacamole/bin/guacenc -f /tmp/trasa/accessproxy/guac/%s.guac", sessionID) + "docker.exe exec guacd nice -n 10 /usr/local/guacamole/bin/guacenc -f /tmp/trasa/accessproxy/guac/%s.guac", sessionID) return exec.Command("powershell", "-c", guacencCmdStr) } guacencCmdStr := fmt.Sprintf( - "sudo docker exec guacd /usr/local/guacamole/bin/guacenc -f /tmp/trasa/accessproxy/guac/%s.guac", sessionID) + "sudo docker exec guacd nice -n 10 /usr/local/guacamole/bin/guacenc -f /tmp/trasa/accessproxy/guac/%s.guac", sessionID) return exec.Command("/bin/bash", "-c", guacencCmdStr) } @@ -110,7 +110,7 @@ func getGuacencCmd(sessionID string) *exec.Cmd { func getFFMPEGcmd(tempFileDir, sessionID string) *exec.Cmd { if os.Getenv("GUACENC_INSTALLED") == "true" { - ffmpegCmdStr := fmt.Sprintf("ffmpeg -i %s/%s.guac.m4v %s/%s.mp4", tempFileDir, sessionID, tempFileDir, sessionID) + ffmpegCmdStr := fmt.Sprintf("nice -n 10 ffmpeg -i %s/%s.guac.m4v %s/%s.mp4", tempFileDir, sessionID, tempFileDir, sessionID) return exec.Command("/bin/bash", "-c", ffmpegCmdStr) } @@ -121,7 +121,7 @@ func getFFMPEGcmd(tempFileDir, sessionID string) *exec.Cmd { } - ffmpegCmdStr := fmt.Sprintf("sudo ffmpeg -i %s/%s.guac.m4v %s/%s.mp4", tempFileDir, sessionID, tempFileDir, sessionID) + ffmpegCmdStr := fmt.Sprintf("sudo nice -n 10 ffmpeg -i %s/%s.guac.m4v %s/%s.mp4", tempFileDir, sessionID, tempFileDir, sessionID) return exec.Command("/bin/bash", "-c", ffmpegCmdStr) }