Load testing using WebRTC/RTMP pulling¶
Overview¶
WebRTC stream pulling from another WCS server may be useful to load testing according to the following test scenario:
- Stream is published on server 1
- Server 2 makes a specified number of Websocket connections (100 for example), as a standalone browser client
- Server 2 pulls a specified number of copies of stream published on server 1, as a viewer
Testing¶
-
For the test we use:
- two WCS servers:
demo.flashphoner.com
andwcs5-us.flashphoner.com
; - web application Two Way Streaming to publish the stream;
- web application Console to make test;
- Chrome browser with Allow-Control-Allow-Origin extension to make Console application to work.
- two WCS servers:
-
Open Console application over HTTP (not HTTPS!) http://demo.flashphoner.com:9091/client2/examples/demo/streaming/console/console.html
-
Install ACAO extension, allow Cross-Origin-Resource-Sharing
-
Enter server name
wcs5-us.flashphoner.com
and pressAdd node
. The server will be a subscriber which pulls streams. Then, add serverdemo.flashphoner.com
which will be a stream source to test
-
Open
Two Way Streaming
application https://demo.flashphoner.com/client2/examples/demo/streaming/two_way_streaming/two_way_streaming.html, then publish the stream from web camera
-
Select
wcs5-us.flashphoner.com
inConsole
application, pressPull streams
button, set the test parameters:Choose node
: choosedemo.flashphoner.com
server to testLocal stream name
,Remote stream name
: set the stream published nameQty
- set the viewers quantity (100
for example)
-
Press
Pull
button. The test begins
-
Select
demo.flashphoner.com
server. The page displays a list of media sessions in which the published stream is played. Current server load information is displayed at top right corner
CDN Edge server load testing¶
CDN Edge server load testing is performed by the following scenario:
- Streams are published to Origin server
- Testing server makes a specified number of Websocket connections (100 for example) to Edge server, as a standalone browser client
- Testing server pulls a specified number of copies of all the streams available to Edge server, as a viewer.
Quick manual on Edge server testing¶
-
For test we use:
- two WCS servers for CDN deployment:
test1.flashphoner.com
andtest2.flashphoner.com
; - WCS server to perform the test
demo.flashphoner.com
; - Two Way Streaming web application to publish stream on Origin server;
- Console web application to perform the test;
- Chrome browser with Allow-Control-Allow-Origin extension to run
Console
web application.
- two WCS servers for CDN deployment:
-
Deploy CDN with the following server roles:
- test1 - Origin
- test2 - Edge
Add the foolowing parameter to Edge server settings
-
Open
Console
application over HTTP (not HTTPS!) http://demo.flashphoner.com:9091/client2/examples/demo/streaming/console/console.html
-
Allow Cross-Origin-Resource-Sharing
-
Enter Edge server name
test2.flashphoner.com
, pressAdd node
. This server will be tested. Adddemo.flashphoner.com
server similarly, this server will be a subscriber which pulls streams
-
Open
Two Way Streaming
application, publish stream from web camera
-
Select
demo.flashphoner.com
server inConsole
application, pressStress play stream
, set the following test parameters:Choose node
: select server for testingtest2.flashphoner.com
Choose test mode
: selectRandom
CDN
: set the checkboxMax streams
: set the number of viewers (100
for example)
-
Press
Start
. The test begins.
RTMP pulling test¶
Since build 5.2.767 it is possible to pull streams via RTMP while testing. This can be enabled using the following parameter on testing server
In test configuration window, choose Proto pull: RTMP
The test itself works like WebRTC test
Tuning recommendations¶
If the load test was failed, it is recommended to change the following setver settings.
-
In flashphoner.properties file extend range of UDP ports and disable fast streaming video decoder start:
-
In wcs-core.properties file extend heap memory limits. It is recommended to set the limit in half of physical RAM, for example, set 16 Gb while physical RAM is 32 Gb. Make sure you have enough RAM:
Known issues¶
1. No more than 1000 streams can be pulled by default¶
Bug
If subscribers quantity set to more than 1000, only 998 streams are pulled