Joachim Bauch's virtual home
random :: entropy
You can find informations about my work and hobbies on this page - powered by icoya OpenContent.
Joachim (Magog)
Red5 speedup
Connect more clients in less time!It has been a while since my last news entry, but I was rather busy with real life(tm) stuff and doing fancy things with Red5. However I just wanted to give you a small sneak peek at a nice speed improvement I just commited to the Red5 trunk and that will be available in the next version.
Up to today, the codepath for connecting clients ran through a synchronized block that made Red5 perform like a single-threaded server - especially if authentication code or database lookups were done for every new user. With the new changes, these things can run multithreaded just as the rest of the server, resulting in rather large speed gains (see below for benchmarks). To make use of the new features, just extend the class MultiThreadedApplicationAdapter instead of the previous ApplicationAdapter and make sure your code is thread-safe ;-)
The following benchmarks have been executed against an application that waited 250 msec in appConnect and result in up to 14 times the number of connections per second!
Regular ApplicationAdapter and old versions of Red5:
# rb -c 5 -n 50 rtmp://localhost/delayed Benchmarking rtmp://localhost/delayed (be patient).....done Waiting for threads to stop.....done Server Hostname: localhost Server Port: 1935 Application path: delayed Concurrency level: 5 Time taken for tests: 12.6250 seconds Complete requests: 50 Failed requests: 0 Requests per second: 3.96 [#/sec] Time per request: 1262.5 [ms] (mean) Time per request: 252.5 [ms] (mean, across all concurrent requests) Percentage of the requests served within a certain time (ms) 50% 1016 66% 1312 75% 1515 80% 1515 90% 1750 95% 1765 98% 1782 99% 1782 100% 1782 (longest request) # rb -c 20 -n 200 rtmp://localhost/delayed Timeout # rb -c 40 -n 400 rtmp://localhost/delayed Timeout
New MultiThreadedApplicationAdapter:
# rb -c 5 -n 50 rtmp://localhost/delayed Benchmarking rtmp://localhost/delayed (be patient).....done Waiting for threads to stop.....done Server Hostname: localhost Server Port: 1935 Application path: delayed Concurrency level: 5 Time taken for tests: 3.4070 seconds Complete requests: 50 Failed requests: 0 Requests per second: 14.68 [#/sec] Time per request: 340.7 [ms] (mean) Time per request: 68.14 [ms] (mean, across all concurrent requests) Percentage of the requests served within a certain time (ms) 50% 312 66% 312 75% 328 80% 344 90% 625 95% 625 98% 641 99% 641 100% 641 (longest request) # rb -c 20 -n 200 rtmp://localhost/delayed Benchmarking rtmp://localhost/delayed (be patient).....done Waiting for threads to stop.....done Server Hostname: localhost Server Port: 1935 Application path: delayed Concurrency level: 20 Time taken for tests: 4.2030 seconds Complete requests: 200 Failed requests: 0 Requests per second: 47.59 [#/sec] Time per request: 420.3 [ms] (mean) Time per request: 21.015 [ms] (mean, across all concurrent requests) Percentage of the requests served within a certain time (ms) 50% 359 66% 406 75% 422 80% 437 90% 515 95% 657 98% 687 99% 719 100% 733 (longest request) # rb -c 40 -n 400 rtmp://localhost/delayed Benchmarking rtmp://localhost/delayed (be patient).....done Waiting for threads to stop.....done Server Hostname: localhost Server Port: 1935 Application path: delayed Concurrency level: 40 Time taken for tests: 7.1250 seconds Complete requests: 400 Failed requests: 0 Requests per second: 56.14 [#/sec] Time per request: 712.5 [ms] (mean) Time per request: 17.813 [ms] (mean, across all concurrent requests) Percentage of the requests served within a certain time (ms) 50% 656 66% 717 75% 734 80% 765 90% 828 95% 890 98% 922 99% 984 100% 1016 (longest request)
Security with Red5 0.6
New tutorial online...A new Red5 tutorial is available, describing the API that can be used to limit access to streams and/or shared objects. Please note that the current trunk or the soon to be released version 0.6rc3 is required to implement security handlers.
Read it in the Red5 tutorials area.
Captcha protection online
No more spamming!?Tonight I implemented a simple captcha solution for my CMS icoya OpenContent, that is active in the comments and in my (finally re-opened) guestbook. If you're interested, get the code from my repository - you can also find the source of my guestbook there.
Please visit my guestbook and leave a short note about how you liked your stay on my website!
Red5 0.6rc2 released
Now with AMF3 support...The Red5 Team is proud to announce the release of Red5 0.6rc2.
Major changes since 0.6rc1:
- Support for AMF3
- RTMP client mode to connect to other Red5 servers
- Compilation with Java6 supported in addition to Java5
- Deferred results
- Paths to VOD files can be customized from serverside code
- Access to streams can be limited
- Stream classes can be customized through red5-common.xml
Read the complete release notes on the official Red5 homepage.
Quick downloads:
- Windows installer (MD5: 348fd2a182bc2480d8d5a912902ea922)
- Mac OSX installer (MD5: dbe7f330cc9b9fb43724d604c874a152)
- WAR package (MD5: 72169fb06372b3bc0131ba1b85ff715f)
- Source tarball (MD5: 7c41ff734cd8153cb3ec37104f5954c1)
New Red5 tutorial
Use custom directories for streams...I just finished another tutorial that describes how custom directories can be used when recording and playing back streams with Red5. Read it in the Red5 tutorials area.







