New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 702421 link

Starred by 10 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Sending small chunk in webrtc datachannels cause high cpu

Reported by shach...@gmail.com, Mar 16 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36

Steps to reproduce the problem:
1. open 2 tabs in http://13.81.0.79:8085/
2. open dev tools - there'll be a number in the console, that's the id
3. In 1 of the tabs fill in 1st input box the other tab's id and connect
4. In the same tab, fill in the 2nd input box with 1200 and press create data
5. then click send data continuously

This will keep on sending 1200 packets synchronously until the bufferedAmount reaches an upper threshold, will stop until it reaches a lower threshold and send again...

What is the expected behavior?
I'd expect the send until bufer is full -> stop until buffer empty, cycles  to be very fast. And cpu to be mostly idle.

What went wrong?
But sometimes my computer never gets to the high buffer threshold because sending on a datachannel buffer of 1200 bytes is so cpu intensive.
If I'd change the buffer to 16000 and repeat this experiment, the cpu is a lot more idle, and actually the throughput measured on the other tab (the receiver) is much better

That's not the case on Firefox.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 57.0.2987.110  Channel: stable
OS Version: OS X 10.11.3
Flash Version: 

On Chrome 56, sometimes the connection would have sort of dropped entirely, meaning that after a few times dc.send would just do nothing, and no messages would be received on the other tab (even though the channel is still open on both ends)
 
Cc: brajkumar@chromium.org
Labels: Needs-Feedback
Tested this issue on Mac OS 10.12 using chrome latest stable M57-57.0.2987.110 by following steps mentioned in the original comment. By opening the Activity monitor in mac observing chrome consumes less cpu usage while comparing with firefox browser.

shacharz@ Attaching screen shot for reference, could you please recheck this issue by creating a new profile under chrome://settings with no apps or extensions in your browser. If issue still persists please share your screen shot for further triaging along with your chrome://gpu details.

Thanks!
Screen Shot 2017-03-17 at 10.41.51 AM.png
62.6 KB View Download

Comment 2 by shach...@gmail.com, Mar 17 2017

Test results:
 FF
  1200: process - 159%, system: 13.29%, User: 31.25%, idle 55.46%
  16000: process - 112.1%, system: 10.61%, User: 20.36%, idle: 69.03%
 CR (incognito)
  1200: process1 - 109.1%, process2- 99.3%, process3 - 73.8%, system: 28.9% , User: 49.11%, idle: 21.99%
  16000: process1 - 93.3%, process2 - 86.2%, process3 - 85.3%, system: 24.42%, User: 49.46%, idle: 26.13

Also, in Chrome it totally janks the frame rate, I can add rAf thingy to make it more visible.

attached gpu details, and shots for the tests

FF-1200.png
438 KB View Download
CR-1200.png
536 KB View Download
CR-16000.png
537 KB View Download
FF-16000.png
417 KB View Download
gpu.html
49.7 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Mar 17 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "brajkumar@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by guidou@chromium.org, Mar 17 2017

Components: -Blink>WebRTC Blink>WebRTC>Network

Comment 5 by shach...@gmail.com, Mar 21 2017

I've updated the page, to also render frames whenever possible (rAf).
That shows that when sending in chrome the main thread gets completely stuck while in firefox all good.
Labels: Needs-Triage-M57
Cc: rbasuvula@chromium.org
Some one from WEBRTC dev team could you please look in to this issue.

Thank You!

Comment 8 Deleted

Owner: pthatcher@chromium.org
Status: Assigned (was: Unconfirmed)
pthatcher@ can you take a look?

Comment 10 by be...@peer5.com, Aug 31 2017

Any update on this CC rbasuvula@chromium.org ?

Sign in to add a comment