Darwin Streaming Server 6.0.3安装、订制、插件或模块
2015-01-05 16:21
411 查看
How to setup Darwin Streaming Server 6.0.3 on 32 or 64 bit Linux platforms, add custom functionality by developing plugins ("modules" as Apple calls them), and results of some performance and load tests I ran
TAG: DSS
TAG: DSS
Darwin Streaming Server 6.0.3 - setup, customization, plugin or module development, performance and load tests on 32 & 64 bit Redhat LinuxHow to setup Darwin Streaming Server 6.0.3 on 32 or 64 bit Linux platforms, add custom functionality by developing plugins ("modules" as Apple calls them), and results of some performance and load tests I ran补丁下载:http://bbs.rosoo.net/forum.php?mod=viewthread&tid=929 IntroductionDarwin Streaming Server is Apple's open source streaming server for the internet. This article will get you started with it, and if you choose to, take you to a certain depth regarding how to tinker with its code to add what you need. It has a very well supported modular architecture, which means you can add one or more custom module(s) - just dropping the binary in a certain folder is sufficient for the server to pick it up and use it. That's what I call plug an play. This is very useful if you do not want to re-build the server's code itself. This article will demonstrate exactly how to do that. Custom modules can be used to perform custom authentication/ authorization, custom logging, reporting, data collection or whatever you have in mind.This article will also discuss the results of some load tests and performance tests I did on the server, trying to discover its limits. My platform was Redhat Linux, but the steps of setting up DSS are pretty much the same for most Unix platforms. Hinting Darwin Streaming Server can stream hinted media files, like mp4 or mov files - Apple formats that can be played back using the Quick Time Player. In fact, it can stream almost any other kind of content, as long as the file is hinted. You can "hint" media files using tools Apple provides. If you need to hint your media files, please research separately. I will assume that you have a catalog of hinted files which your Darwin server will stream to a Quicktime player (or any other player able to play Apple streams) running on some machine which can communicate with your server. The default installation of Darwin already comes with some sample hinted media files. To set up and test, you do not need any more files. Platform and Hardware $ cat /etc/redhat-release |
# of concurrent users | CPU (Forked Server) | CPU Idle (Overall) | Memory (Server Process) | Stable? | Bandwidth (MBPS) |
---|---|---|---|---|---|
100 | 1% | 99% | 4 MB | yes | 3.75 |
200 | 2% | 97% | 7 MB | yes | 7.5 |
300 | 3% | 96% | 12 MB | yes | 11.25 |
350 | 4% | 96% | 21 MB | yes | 13.125 |
400 | 4% | 96% | 22 MB | no | - |
I did not notice any memory leaks - in stable mode, it ran constantly for weeks, processing 350 continuous and concurrent users, with no leaks perceived.
Running multiple DSS servers for scalability
For some, that could be enough. I needed more. There is a solution though - even when DSS topples over with 400 users, it uses virtually no CPU & memory (which indicates that the bottleneck is somewhere in the code, and that makes me bolder when I think that it can be fixed). This "leanness" can be effectively used by running multiple DSS servers!
While executing the server, we can pass -c <whatever streamingserver.xml we want>. If we create multiple streamingserver.xml files, each with a different port listed in "rtsp_port" entry (like 7070 in one, 554 in another, and so on), and then execute multiple DSS instances each using a separate streamingserver.xml as configuration file, we can achieve this. I have parallelly run 3 instances of the server, each processing 350 concurrent users - that is one way to reach four digits - 1000 users!
Only caveat is the url you pass to openRTSP (or whatever client you are using) must access the correct instance of the server using the port number specified using a colon after the hostname. If you are thinking of using this setup in real world, you have to write another application - a software load balancer, that will listen on any given port, and delegate the request to any of the N running DSS instances. Clients then must connect to that port always. I have not yet tried this thing out though.
RTSP, RTP, UDP, RUDP, TCP...
While dealing with Darwin Streaming Server, you will come across these acronyms. At times you will have to choose one over another. For example, while setting up StreamingLoadTool (the load test tool that comes inherently with DSS), its configuration file has entries where you pick the mode of execution - RUDP? UDP? TCP? You can retain the defaults if you are not sure what to pick.Explaining the differences and meanings of these is beyond the scope of this article. May be in a future article. I mention these here because you need to understand these concepts to get the most out of DSS. If you are only setting up a server for your users to use - you may ask - why do you care whether it is doing RUDP or UDP? At the beginning, you might not need to care. But if lots of users are using your service, you may be asked which one gives higher throughput. They may be using clients of varying capabilities, and ones that gives it users the option to pick a mode.
For absolute beginners, just inderstand this much: RTSP is the protocol of delivery (corresponds to HTTP). RTP is the underlying protocol used for packets transfers by RTSP. TCP and UDP are alternate network protocols - TCP is characterized by high reliability but low timeliness, as it involves a lot of handshaking (ACK-s, NACK-s etc). UDP is characterized by low reliability (packets may not make it to the other end) but high timeliness. R-UDP is Apple's proprietary version of UDP that adds some handshaking, thus they call it "Reliable UDP". Here is an article that attempts a better explanation: http://www.vbrick.net/Topics/RTSP.asp.
You may ask why does DSS need to deal with these concepts? Any streaming server would, as its sole job is to deliver a streaming media to the client - which, as opposed to playing back a file, is characterized by the fact that nothing is stored on the client side. Bits must be transmitted exactly at the speed that the video being played demands - a lighter scene may need 100,000 bits per second, and a darker scene may need 700,000 bits per second. This number is called the bitrateof the video. Coordinating this transfer, where the speed goes up and down, ensuring reliability and handshaking is the complex domain of streaming servers. And it cannot be solved by HTTP, as HTTP can only fetch the whole file (it can also fetch partial files based on byte range requests) but it cannot fetch a file continuously over the same connection. RTSP, RTMP, etc are protocols used for this purpose.
Conclusion
Apple guys have coded this well. A reviewer, on afterthought, can always point out areas of improvement, but the project is so massive that finally ending up with a coherent, working and mostly bugfree set of files of this magnitude is a commendable achievement.Usage of so many static variables is something I do not like - it exerts pressure on the heap. And amateurishly conceived utility classes like StrPtrLen literally drives me mad - these guys have created a class to hold a pointer to sombody else's data! Please be extremely careful while using this almost criminal class - it invites misuse. Overall, the code could have been neater, but hey, I did not pay for this. I will take what DSS is worth for.
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)About the Author
Koushik serves Yahoo! Video Streaming Center from its Dallas location. An Electronics Engineer from Jadavpur University, he is father to twin daughters. Apart from spending time with work and projects, he loves cricket, Kishore Kumar, Bruce Willis, camping and fishing, Mediterranean food, sea beaches and his gas grill.原文出处
(Koushik Biswas )
from:http://www.rosoo.net/a/201008/10062.html
相关文章推荐
- Linux编译安装Darwin Streaming Server 6.0.3
- Darwin Streaming Server 6.0.3 之一 : 编译安装
- Darwin streaming server6.0.3安装与rtp-over-tcp
- darwin streaming server 6.0.3安装方法(正确安装方法在文最后) 推荐
- ubuntu12.04-32位-安装Darwin Streaming Server6.0.3流媒体服务器
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3
- Linux编译安装Darwin Streaming Server 6.0.3。。。
- ubuntu12.04-32位-安装Darwin Streaming Server6.0.3流媒体服务器
- Darwin Streaming Server安装
- Darwin Streaming Server 安装流程
- rtsp移动流媒体服务器Darwin Streaming Server安装和配置
- 在Linux中编译安装Darwin Streaming Server