Mixer load testing¶
Overview¶
If server use case involves stream mixing, mixer load testing may be necessary before you put server into production. The mixer testing is carried out as follows:
- The required number of streams are published on server (at least one stream per mixer)
- The specified number of audiomixers are created, and streams are fed to mixers input. One stream can be fed to one mixer input only
- Mixers work for desired time then they will be destroyed and created again until the test is finished.
The server behavior can be observed with monitoring tools while testing.
To manage mixel load testing the special REST API queries are used.
REST API¶
A REST-query must be an HTTP/HTTPS POST query in the following form:
- HTTP:
http://streaming.flashphoner.com:8081/rest-api/mixer/test/start
- HTTPS:
https://streaming.flashphoner.com:8444/rest-api/mixer/test/start
Here:
streaming.flashphoner.com
- is the address of the WCS server8081
- the standard REST / HTTP port of the WCS server8444
- the standard HTTPS portrest-api
- the required prefixmixer/test/start
- the REST-method used
REST methods¶
/mixer/test/start¶
Start the test
Request example¶
POST /mixer/test/start HTTP/1.1
Host: localhost:8081
Content-Type: application/json
{
"feedingStreams": [
"s1",
"s2",
"s3",
"s4"
],
"mixerCount": 2,
"streamsInMixer": 2,
"intervalInSeconds": 60
}
Response example¶
Return codes¶
Code | Reason |
---|---|
200 | OK |
500 | Internal error |
/mixer/test/stop¶
Stop the test
Request example¶
Response example¶
Return codes¶
Code | Reason |
---|---|
200 | OK |
404 | Mixer not found |
500 | Internal error |
/mixer/test/get_start_example¶
Return JSON object sample to pass to /mixer/test/start
method
Request example¶
POST /mixer/test/get_start_example HTTP/1.1
Host: localhost:8081
Content-Type: application/json
{
"feedingStreams": [
"stream1",
"stream2",
"stream3"
],
"mixerCount": 3,
"streamsInMixer": 1,
"intervalInSeconds": 60
}
Response example¶
Return codes¶
Code | Reason |
---|---|
200 | OK |
500 | Internal error |
Parameters¶
Parameter name |
Description |
Example |
---|---|---|
feedingSteams |
Stream published list to participate in test |
|
mixerCount | Number of mixers created | 2 |
streamsInMixer | Number of streams fed to each mixer input | 2 |
intervalInSeconds | Interval in seconds to destroy mixers and create them again | 60 |
Configuration¶
To test mixer perfomance under high load, asynchronous media session disconnection (which is enabled by default) should be disabled
WCS should be restarted to apply.
When test is finished, this setting must be removed from configuration file.
Testing¶
-
For test we use:
- WCS server
- Chrome browser and REST-client to send queries
Two Way Streaming
web application to publish streams
-
Publish streams named
s1
,s2
,s3
,s4
-
Open REST client. Send
/mixer/test/start
query with the following parameters:- streams published list:
s1, s2, s3, s4
- number of mixers:
2
- number of streams per mixer:
2
- mixer work interval:
120
seconds
- streams published list:
-
Make sure mixers are created sending
/mixer/find_all
query
Two mixersmixer0
andmixer1
should be found
-
Server resource consumption can be observed while testing with Java Mission Control, load and resource usage information and error information pages, and server logs.
-
Stop the test with
/mixer/test/stop
query
Tuning recommendations¶
-
If large CPU load was detected during testing, follow server tuning recommendations.
-
If resource leak was detected during testing, send detailed test description and report collected to support@flashphoner.com