<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
LINE-HEIGHT: 1.5; FONT-FAMILY: 微软雅黑; COLOR: #000080; FONT-SIZE: 10.5pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 9.00.8112.16457"></HEAD>
<BODY style="MARGIN: 10px">
<DIV>thank you very much</DIV>
<DIV>I know what's your mean.</DIV>
<DIV> </DIV>
<DIV>let's calc it:</DIV>
<DIV>the centos of our server will be limited about 300 thread (optimized by
ulimited and etc)</DIV>
<DIV>and one user of our app will be created 5 thread in gstreamer, </DIV>
<DIV>so our capacity is about 60 users, and our app is peer-call, </DIV>
<DIV>so our server which is using gstreamer is only support 30 calls maxly</DIV>
<DIV> </DIV>
<DIV>then, we discuss:</DIV>
<DIV>1. gstreamer is a very beautiful framework, so if it design for
server next step, I think it must be more beautiful</DIV>
<DIV>2. whatever for client or server, the thread num which is related
with element is a ugly idea</DIV>
<DIV>3. is there any roadmap of gstreamer to support confirmed thread
num</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>
<DIV><SPAN
style="FONT-STYLE: italic; FONT-FAMILY: 微软雅黑; COLOR: #000000; FONT-SIZE: 10.5pt; FONT-WEIGHT: normal"></SPAN> </DIV>
<DIV><SPAN
style="FONT-STYLE: italic; FONT-FAMILY: 微软雅黑; COLOR: #000000; FONT-SIZE: 10.5pt; FONT-WEIGHT: normal">王振中</SPAN></DIV>
<DIV><SPAN
style="FONT-STYLE: italic; FONT-FAMILY: 微软雅黑; COLOR: #000000; FONT-SIZE: 10.5pt; FONT-WEIGHT: normal"></SPAN> </DIV>
<DIV><SPAN
style="FONT-STYLE: italic; FONT-FAMILY: 微软雅黑; COLOR: #000000; FONT-SIZE: 10.5pt; FONT-WEIGHT: normal"></SPAN> </DIV>
<DIV><SPAN
style="FONT-STYLE: italic; FONT-FAMILY: 微软雅黑; COLOR: #000000; FONT-SIZE: 10.5pt; FONT-WEIGHT: normal"></SPAN> </DIV></SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<DIV
style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND: #efefef; COLOR: #000000; FONT-SIZE: 12px; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:bilboed@bilboed.com">Edward
Hervey</A></DIV>
<DIV><B>Date:</B> 2014-07-25 15:07</DIV>
<DIV><B>To:</B> <A href="mailto:wangzz@avonaco.com">wangzz</A>; <A
href="mailto:gstreamer-devel@lists.freedesktop.org">Discussion of the
development of and with GStreamer</A></DIV>
<DIV><B>Subject:</B> Re: how to limit the thread number?</DIV></DIV></DIV>
<DIV>
<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>On Fri, 2014-07-25 at 09:58 +0800, Wang Zhenzhong wrote:</DIV>
<DIV>> Hi:</DIV>
<DIV>> every body, we are using gstreamer for develop media server.</DIV>
<DIV>> the media server need support many audio/video user,</DIV>
<DIV>> so every user include udpsrc/rtpsrc/decode/encode/rtpsink/udpsink...</DIV>
<DIV>> must create about 3-5 threads</DIV>
<DIV> </DIV>
<DIV> That sounds about right</DIV>
<DIV> </DIV>
<DIV>> but the centos's thread num and memory is limited, so the capability</DIV>
<DIV>> of our server is limited by gstreamer's thread number</DIV>
<DIV> </DIV>
<DIV> Have you investigated changing those limits ? via ulimit/getrlimit.</DIV>
<DIV> </DIV>
<DIV>> </DIV>
<DIV>> is there anyway to limit the thread num of gstreamer? such as</DIV>
<DIV>> confirmed thread num in startup and unrelated to user num</DIV>
<DIV> </DIV>
<DIV> GStreamer is multi-threaded, it *needs* those (streaming) threads to</DIV>
<DIV>work. If a thread can't be created, it will fail. What you can do</DIV>
<DIV>though, is figure out how many threads will be created.</DIV>
<DIV> </DIV>
<DIV> The rule of thumb is (roughly):</DIV>
<DIV> * queue element will create one new streaming thread</DIV>
<DIV> * sources (when working push-based, such as udpsrc) or demuxers (when</DIV>
<DIV>working pull-based) will create one new streaming thread</DIV>
<DIV> * Some other elements might create a streaming thread (such as the</DIV>
<DIV>jitterbuffer normally used in client-side RTP pipelines).</DIV>
<DIV> </DIV>
<DIV> If you're not sure, create one pipeline (I'm assuming your pipelines</DIV>
<DIV>are identical), and look at how many threads are running (top, and then</DIV>
<DIV>'H' to view each thread is quite useful for that). Take your thread</DIV>
<DIV>limits, divide it by that => you have your maximum number of clients you</DIV>
<DIV>can accept. But once again, you should check whether you can change the</DIV>
<DIV>limit of threads via ulimit/getrlimit first.</DIV>
<DIV> </DIV>
<DIV> Regards,</DIV>
<DIV> </DIV>
<DIV> Edward</DIV>
<DIV> </DIV>
<DIV>> </DIV>
<DIV>> thankyou </DIV>
<DIV>> </DIV>
<DIV>> </DIV>
<DIV>> </DIV>
<DIV>> ______________________________________________________________________</DIV>
<DIV>> </DIV>
<DIV>> 王振中</DIV>
<DIV>> </DIV>
<DIV>> </DIV>
<DIV>> </DIV>
<DIV>> _______________________________________________</DIV>
<DIV>> gstreamer-devel mailing list</DIV>
<DIV>> gstreamer-devel@lists.freedesktop.org</DIV>
<DIV>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</DIV>
<DIV> </DIV>
<DIV> </DIV></DIV></BODY></HTML>