Red5: Benchmarking dan Testing

From OnnoWiki
Jump to navigation Jump to search

Red5Bench is a custom JMeter http://jakarta.apache.org/jmeter/ benchmark tool which will be able to profile and mimick multiple concurrent streams and connections to the Red5 server. It uses an extended

RTMPClient which produces custom callback methods for wrapping resultRecieved, wraps to extend the send params, aswell as implementing RTMPTClient.

http://red5.electroteque.org/dev/bench/RTMPClientExtended.zip
http://red5.electroteque.org/dev/bench/Red5Bench.zip 

Still major issues trying to get asynchronous bench tests to produce results. Results file is not ok, but gui is showing returned calls ok.

Usage:

ant build - will compile the benchmark application.
playback-test - Calls org.red5.server.bench.test.PlayBackTest
callback-test - Calls org.red5.server.bench.test.CallbackTest
publish-test - Calls org.red5.server.bench.test.PublishTest
sharedobject-test - Calls org.red5.server.bench.test.SharedObjectTest
connect-plan - Runs ConnectionTestPlan.jmx test plan for connections.
playback-plan - Runs PlaybackTestPlan.jmx test plan for playback.
publish-plan - Runs PublishTestPlan.jmx test plan for publish.
so-plan - Runs SharedObjectPlan.jmx test plan for shared objects.
playback-plan-nogui - Runs PlaybackTestPlan.jmx test plan but logs results to a file. 
publish-plan-nogui - Runs PublishTestPlan.jmx test plan but logs results to a file.
cb-plan-nogui - Runs CallbackTestPlan.jmx test plan but logs results to a file.
cb-plan - Runs CallbackTestPlan.jmx test plan for callbacks.

The profile file Red5BenchPlan.jmx has many different graph report and requesters setup. To change the defaults, inside a Jmeter instance load the profile file and click "Red5 Bench Request" java requester in the menu.

There is multiple arguments which can be configured:

port - the port number to connect with.
host - the hostname to connect with.
app - the server application name.
file - the file to request and stream. 

Select the syncronizing timer "Concurrent User Timer", change the "Number of Simulated Users to Group by" to the ammount of concurrent requests to hit the server with (defaults to 100).

If launching the profiler into Jmeter to start the benchmark choose Run -> Start in the menu.

You will see a counter in the top menu, the profile will not run until it reaches the concurrent request limit.

Example directly running the tool in java:

java org.red5.server.bench.test.Red5Bench -p 1935 -h localhost -a perfTest 
java org.red5.server.bench.test.CallbackTest -p 1935 -h localhost -a perfTest --method echo --call-arg test
java org.red5.server.bench.test.PlayBackTest -p 1935 -h localhost -a perfTest -f videofile.flv 
java org.red5.server.bench.test.PublishTest -p 1935 -h localhost -a perfTest -f videofile.flv -d streams -n publishtest -m live (live/record/append)
java org.red5.server.bench.test.SharedObjectTest -p 1935 -h localhost -a perfTest --shared-obj test --shared-obj-vals testvar:testval --shared-obj-vals testvar2:testval


Referensi

Pranala Menarik