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^

  1. The required number of streams are published on server (at least one stream per mixer)
  2. The specified number of audiomixers are created, and streams are fed to mixers input. One stream can be fed to one mixer input only/
  3. 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 queries

A REST-query must be an HTTP/HTTPS POST query in the following form:

Here:

REST methods and response statuses

REST method

Example of REST query

Example of response

Response statuses

Description

/mixer/test/start

{
    "feedingStreams": [
        "s1",
        "s2",
        "s3",
        "s4"
    ],
    "mixerCount": 2,
    "streamsInMixer": 2,
    "intervalInSeconds": 60
}


200 - OK

500 - Internal error

Start the test

/mixer/test/stop

{
}

200 - OK

404 - Mixer not found

500 - Internal error

Stop the test

/mixer/test/get_start_example


{
    "feedingStreams": [
        "stream1",
        "stream2",
        "stream3"
    ],
    "mixerCount": 3,
    "streamsInMixer": 1,
    "intervalInSeconds": 60
}

200 - OK

500 - Internal error

Return JSON object sample to pass to /mixer/test/start method

Parameters

Parameter name

Description

Example

feedingSteams

Stream published list to participate in test
["s1","s2","s3","s4"]
mixerCountNumber of mixers created2
streamsInMixerNumber of streams fed to each mixer input2
intervalInSecondsInterval in seconds to destroy mixers and create them again60

Configuration

To test mixer perfomance under high load, asynchronous media session disconnection (which is enabled by default) should be disabled

handler_async_disconnect=false

WCS should be restarted to apply.

When test is finished, this setting must be removed from configuration file.

Testing

1. For test we use:

2. Publish streams named s1, s2, s3, s4

3. Open REST client. Send /mixer/test/start query with the following parameters:

4. Make sure mixers are created sending /mixer/find_all query

Two mixers mixer0 and mixer1 should be found

5. Server resource consumption can be observed while testing with Java Mission Control, load and resource usage information and error information pages, and server logs.

6. Stop the test with /mixer/test/stop query

Tuning recommendations

1. If large CPU load was detected during testing, follow server tuning recommendations.

2. If resource leak was detected during testing, send detailed test description and the following files to support@flashphoner.com: