Web RTC High CPU on Peer-To-Peer Reconnection

1,245 views
Skip to first unread message

Sheldon Pijpers

unread,
Dec 5, 2017, 9:52:48 AM12/5/17
to discuss-webrtc
On a chat website that uses a Web RTC framework to create a peer-to-peer connection between users the website keeps on maximizing it's "Google Chrome Helper" CPU. After a few reconnections, the CPU load is very high, the browser becomes unresponsive, and my laptop starts fuming (this happens on iOS and Windows computers). 

Steps to reproduce the problem:
1. Visit website (https://www.kosmochat.com) 
2. Test out webcam chat connections in two tabs (connect with yourself)
3. Reconnect with yourself a few times
4. Notice CPU is growing constantly

What is the expected behavior?
CPU levels maintain stable (this does not happen, the CPU load increases after each reconnection)

What went wrong?
The CPU levels keep on growing, which makes the website (and doing any other tasks) unusable after some time.

Video of bug:
https://vimeo.com/245910140
password: bug


Philipp Hancke

unread,
Dec 5, 2017, 10:10:25 AM12/5/17
to WebRTC-discuss
if you don't close the peerconnection you will probably end up encoding the video multiple times on connections that are no longer connected. Check the state on chrome://webrtc-internals which also gives an indication for cpu usage in one of the many graphs.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/4a698e6a-c16d-4582-9dcd-e1417457721c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sheldon Pijpers

unread,
Dec 7, 2017, 9:58:50 AM12/7/17
to discuss-webrtc
So in essence, it's not possible to provide an ongoing peer-to-peer network connection utilizing the Web RTC framework? If I understand your answer correctly, there is no solution to the HIGH CPU load. Is there a way to stop the encoding of the video multiple times for closed connections? Sorry for the questions; just want to know if there might be a possible solution to this.
 

Sheldon Pijpers

unread,
Dec 7, 2017, 9:58:58 AM12/7/17
to discuss-webrtc
So in essence, it's not possible to provide an ongoing peer-to-peer network connection utilizing the Web RTC framework? If I understand your answer correctly, there is no solution to the HIGH CPU load. Is there a way to stop the encoding of the video multiple times for closed connections? Sorry for the questions; just want to know if there might be a possible solution to this.


On Tuesday, December 5, 2017 at 3:10:25 PM UTC, Philipp Hancke wrote:
if you don't close the peerconnection you will probably end up encoding the video multiple times on connections that are no longer connected. Check the state on chrome://webrtc-internals which also gives an indication for cpu usage in one of the many graphs.
2017-12-05 15:52 GMT+01:00 Sheldon Pijpers <sheldona...@gmail.com>:
On a chat website that uses a Web RTC framework to create a peer-to-peer connection between users the website keeps on maximizing it's "Google Chrome Helper" CPU. After a few reconnections, the CPU load is very high, the browser becomes unresponsive, and my laptop starts fuming (this happens on iOS and Windows computers). 

Steps to reproduce the problem:
1. Visit website (https://www.kosmochat.com) 
2. Test out webcam chat connections in two tabs (connect with yourself)
3. Reconnect with yourself a few times
4. Notice CPU is growing constantly

What is the expected behavior?
CPU levels maintain stable (this does not happen, the CPU load increases after each reconnection)

What went wrong?
The CPU levels keep on growing, which makes the website (and doing any other tasks) unusable after some time.

Video of bug:
https://vimeo.com/245910140
password: bug


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Silvia Pfeiffer

unread,
Dec 7, 2017, 2:22:48 PM12/7/17
to discuss...@googlegroups.com
It's a bug in kosmochat. They are not properly closing down a peerconnection when you hit quit. Forward them the video.

Best Regards,
Silvia.

To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/ed544e23-6210-4d53-96da-aa8a798c1528%40googlegroups.com.

Iñaki Baz Castillo

unread,
Dec 8, 2017, 3:57:45 PM12/8/17
to discuss...@googlegroups.com
I think you should re-read the message from Phillipp.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "discuss-webrtc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to discuss-webrt...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/discuss-webrtc/da5123a9-7f50-42b3-ace0-39fa38747de2%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Iñaki Baz Castillo
<i...@aliax.net>
Reply all
Reply to author
Forward
0 new messages