From daaf73d39018ef836754823939c76eb541cbc33a Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Sat, 16 Oct 2021 14:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcpu=E4=BA=B2=E5=92=8C?= =?UTF-8?q?=E6=80=A7=E8=AE=BE=E7=BD=AE=E5=AF=BC=E8=87=B4FFmpeg=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E4=B8=8D=E8=83=BD=E4=BD=BF=E7=94=A8=E5=A4=9A=E6=A0=B8?= =?UTF-8?q?cpu=E7=9A=84=E9=97=AE=E9=A2=98:#1149?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/Process.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/Process.cpp b/server/Process.cpp index 9a75ee58..6e3e46ad 100644 --- a/server/Process.cpp +++ b/server/Process.cpp @@ -75,6 +75,8 @@ void Process::run(const string &cmd, const string &log_file_tmp) { throw std::runtime_error(StrPrinter << "fork child process failed,err:" << get_uv_errmsg()); } if (_pid == 0) { + //取消cpu亲和性设置,防止FFmpeg进程cpu占用率不能超过100%的问题 + setThreadAffinity(-1); string log_file; if (log_file_tmp.empty()) { //未指定子进程日志文件时,重定向至/dev/null