chromoting host consumes too much CPU resources when using webrtc |
|||
Issue description1. Connect to chromoting host using webrtc-based client. 2. Observe that the host constantly consumes more than a one CPU core, even when the screen is static. In addition to that Xvfb consumes about 30%: Top 3 threads as reported by top: %CPU %MEM TIME+ COMMAND 63.7 0.3 0:19.43 ChromotingCaptu 35.1 0.2 6:52.46 Xvfb 33.5 0.3 0:12.81 ChromotingNetwo I see this issue with 65.0.3325.39 and on trunk builds of the host. Numbers above from the trunk build. On 65* CPU consumption is higher because always sends 5fps before https://chromium-review.googlesource.com/c/chromium/src/+/907591.
,
Feb 27 2018
Eek! WebrtcFrameSchedulerSimple::CaptureNextFrame() is getting called in a tight loop! That CL was part of Zijie's work to support H264 encode. It was a while ago - I don't know if it makes sense to revert that, or if it will revert cleanly. I think I'd rather just fix the logic to ensure we don't capture more often than kTargetFrameRate.
,
Feb 27 2018
Also, if we need to spin a new M65 release, we should aim for a simple fix.
,
Feb 27 2018
Looking...
,
Feb 27 2018
I have a simple fix, just writing a unittest for this now.
,
Mar 1 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/65f6394de68d8e96184234f5b7c8bf1e80f699f1 commit 65f6394de68d8e96184234f5b7c8bf1e80f699f1 Author: Lambros Lambrou <lambroslambrou@chromium.org> Date: Thu Mar 01 00:36:53 2018 [remoting host] Rate-limit capturer to 30FPS For WebRTC-enabled connections, ensure capturer is not scheduled more often than 30FPS, to limit CPU usage. Bug: 816727 Change-Id: If2efd9de0749848f209fad7ed1926be108f402c3 Reviewed-on: https://chromium-review.googlesource.com/940449 Reviewed-by: Zijie He <zijiehe@chromium.org> Commit-Queue: Lambros Lambrou <lambroslambrou@chromium.org> Cr-Commit-Position: refs/heads/master@{#539957} [modify] https://crrev.com/65f6394de68d8e96184234f5b7c8bf1e80f699f1/remoting/protocol/webrtc_frame_scheduler_simple.cc
,
Mar 1 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/66afc5e5d10127546cc4b98b9117aff588b5e66b commit 66afc5e5d10127546cc4b98b9117aff588b5e66b Author: Lambros Lambrou <lambroslambrou@chromium.org> Date: Thu Mar 01 20:48:46 2018 [remoting host] Simplify capture scheduling logic This removes an unnecessary section from WebrtcFrameSchedulerSimple::ScheduleNextFrame() to address review comments on https://chromium-review.googlesource.com/940449 and potentially improves performance and b/w utilization. Bug: 816727 Change-Id: I76aaf326a48f985880ea7ff4ba4e16cc246862b3 Reviewed-on: https://chromium-review.googlesource.com/942484 Reviewed-by: Zijie He <zijiehe@chromium.org> Commit-Queue: Lambros Lambrou <lambroslambrou@chromium.org> Cr-Commit-Position: refs/heads/master@{#540276} [modify] https://crrev.com/66afc5e5d10127546cc4b98b9117aff588b5e66b/remoting/protocol/webrtc_frame_scheduler_simple.cc
,
Mar 3 2018
,
Mar 13 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f018c9b26cd58e0438c6f28bfcaa8245fdb69fa8 commit f018c9b26cd58e0438c6f28bfcaa8245fdb69fa8 Author: Lambros Lambrou <lambroslambrou@chromium.org> Date: Tue Mar 13 00:24:24 2018 [remoting host] Add unittest for capturing at 30FPS. This adds a unittest for the bug fixed in http://crrev.com/65f6394de68d8e96184234f5b7c8bf1e80f699f1 This updates the scheduler and unittests to use a mock clock implementation from TestMockTimeTaskRunner, instead of just mocking the current time directly. Bug: 816727 Change-Id: I194af8e65bae70f0af3a202e0bbb7653059abcaf Reviewed-on: https://chromium-review.googlesource.com/947575 Commit-Queue: Lambros Lambrou <lambroslambrou@chromium.org> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org> Cr-Commit-Position: refs/heads/master@{#542666} [modify] https://crrev.com/f018c9b26cd58e0438c6f28bfcaa8245fdb69fa8/remoting/protocol/webrtc_frame_scheduler_simple.cc [modify] https://crrev.com/f018c9b26cd58e0438c6f28bfcaa8245fdb69fa8/remoting/protocol/webrtc_frame_scheduler_simple.h [modify] https://crrev.com/f018c9b26cd58e0438c6f28bfcaa8245fdb69fa8/remoting/protocol/webrtc_frame_scheduler_unittest.cc |
|||
►
Sign in to add a comment |
|||
Comment 1 by sergeyu@chromium.org
, Feb 27 2018