winlin

update readme, multiple process and cli architecture.

正在显示 1 个修改的文件 包含 48 行增加18 行删除
@@ -239,25 +239,55 @@ Schema#2: SRS RTMP Edge server pull stream from origin (or upstream SRS @@ -239,25 +239,55 @@ Schema#2: SRS RTMP Edge server pull stream from origin (or upstream SRS
239 </pre> 239 </pre>
240 (plan) SRS Multiple processes Architecture:<br/> 240 (plan) SRS Multiple processes Architecture:<br/>
241 <pre> 241 <pre>
242 - +---------------------------+  
243 - +-----+ worker process(3) |  
244 -+----------------+ | +---------------------------+  
245 -| master process |---(2)---+  
246 -| (1)manager | | +---------------------------+  
247 -+----------------+ +-----+ worker process N |  
248 - | +---------------------------+  
249 - |  
250 - | +---------------------------+  
251 - +-----+ bandwidth test process(4) |  
252 - +---------------------------+ 242 + +-------------------+ +-----------+
  243 + | upnode server | + client +
  244 + +---------+---------+ +-----+-----+
  245 + --------------+------------network-------+---------
  246 + | |
  247 + +-----------+ +----+-----------+ +----+------+
  248 + | master +--fork->-+ back source(1) +-->-pull-+ stream(2) +
  249 + +-----+-----+ +----------------+ +-------+---+
  250 + +-------------------------------------fork--->-----+
  251 + | +-------------------+
  252 + +--fork->--+ bandwidth test(3) +
  253 + +-------------------+
  254 +
  255 +Remark:
  256 +(1) back source process: create by master process, get stream from
  257 + upnode server, serve the stream process.
  258 +(2) stream process: create by master process, get stream from back
  259 + source process, serve the client.
  260 +(3) bandwidth test process: create by master process, serve the
  261 + bandwidth test client.
  262 +Remark:
  263 +(a) This multiple processes architecture is design by wenjie, it's a
  264 + very simple and powerful multiple process architecture, for the
  265 + master no need to pass between stream process.
  266 +(b) The CLI architecture is similar to this, instead, cli process
  267 + will collect informations from all stream process, master process
  268 + only send signals to child processes.
  269 +</pre>
  270 +CLI Architecture:
  271 +<pre>
  272 + +---------+
  273 + +--+ stream1 +---------+
  274 + | +---------+ |
  275 + +--------+ | +---------+ | +-------+
  276 + | master +--fork->-+--+ streamN +---pull--+>--+ cli +
  277 + +--------+ | +---------+ | +-------+
  278 + | +-------------+ |
  279 + +--+ back source +-----+
  280 + +-------------+
253 Remark: 281 Remark:
254 -(1) master process: to fork processes, schedule fd(client) to the "right"  
255 - process, forward messages between processes  
256 -(2) communication: master process use unix domain socket to communicate  
257 - with worker processes.  
258 -(3) worker process: to provide RTMP streaming service, generate HLS files.  
259 -(4) bandwidth test process: for all bandwidth test request, to make the  
260 - bandwidth testing has minimal effect to streaming service 282 +(1) master listen the global api port, for example, 33330
  283 +(2) back source and stream processes listen at private api port,
  284 + for example, 33331, 33332, 33333
  285 +(3) work processes(stream and back-source), report private api
  286 + port to master global api port.
  287 +(4) cli connect to master global api port, get all other private
  288 + api ports
  289 +(5) cli connect to each stream/back-source process to get api data,
  290 + cli analysis and summary the data, return to user.
261 </pre> 291 </pre>
262 Bandwidth Test Workflow: 292 Bandwidth Test Workflow:
263 <pre> 293 <pre>