<div dir="ltr"><div>40 clients, ~40% CPU usage.</div><div>gprof results:<br></div><div><br></div><div>Flat profile:</div><div><br></div><div>Each sample counts as 0.01 seconds.</div><div>  %   cumulative   self              self     total</div><div> time   seconds   seconds    calls  us/call  us/call  name</div><div> 20.76      0.11     0.11   150000     0.73     3.47  BasicTaskScheduler::SingleStep(unsigned int)</div><div> 11.32      0.17     0.06    61120     0.98     1.04  DelayQueue::addEntry(DelayQueueEntry*)</div><div>  9.43      0.22     0.05    58657     0.85     1.36  RTPInterface::sendPacket(unsigned char*, unsigned int)</div><div>  7.55      0.26     0.04    58296     0.69     0.69  DelayQueue::removeEntry(long)</div><div>  5.66      0.29     0.03    58611     0.51     0.51  MultiFramedRTPSink::buildAndSendPacket(unsigned char)</div><div>  3.77      0.31     0.02  3231064     0.01     0.01  HandlerIterator::next()</div><div>  3.77      0.33     0.02   326217     0.06     0.06  DelayQueue::synchronize()</div><div>  3.77      0.35     0.02   150000     0.13     0.18  DelayQueue::handleAlarm()</div><div>  3.77      0.37     0.02   117586     0.17     0.17  NetInterfaceTrafficStats::countPacket(unsigned int)</div><div>  3.77      0.39     0.02    58610     0.34     0.34  SimpleRTPSink::doSpecialFrameHandling(unsigned int, unsigned char*, unsigned int, timeval, unsigned int)</div><div>  3.77      0.41     0.02    58610     0.34     2.91  MultiFramedRTPSink::sendPacketIfNecessary()</div><div>  3.77      0.43     0.02    58610     0.34     3.76  MPEG2TransportStreamFramer::afterGettingFrame1(unsigned int, timeval)</div><div>  1.89      0.44     0.01   150000     0.07     0.12  DelayQueue::timeToNextAlarm()</div><div>  1.89      0.45     0.01   117222     0.09     0.09  FramedSource::getNextFrame(unsigned char*, unsigned int, void (*)(void*, unsigned int, unsigned int, timeval</div><div>, unsigned int), void*, void (*)(void*), void*)</div><div>  1.89      0.46     0.01   116338     0.09     0.17  BasicTaskScheduler::setBackgroundHandling(int, int, void (*)(void*, int), void*)</div><div>  1.89      0.47     0.01    90105     0.11     0.11  HandlerIterator::reset()</div><div>  1.89      0.48     0.01    61120     0.16     1.21  BasicTaskScheduler0::scheduleDelayedTask(long, void (*)(void*), void*)</div><div>  1.89      0.49     0.01    58658     0.17     0.17  writeSocket(UsageEnvironment&, int, in_addr, unsigned short, unsigned char*, unsigned int)</div><div>  1.89      0.50     0.01    58610     0.17     3.42  MultiFramedRTPSink::afterGettingFrame1(unsigned int, unsigned int, timeval, unsigned int)</div><div>  1.89      0.51     0.01    58151     0.17     0.17  HandlerDescriptor::~HandlerDescriptor()</div><div>  1.89      0.52     0.01       22   454.56   454.56  MultiFramedRTPSink::MultiFramedRTPSink(UsageEnvironment&, Groupsock*, unsigned char, unsigned int, char cons</div><div>t*, unsigned int)</div><div>  1.89      0.53     0.01                             BasicTaskScheduler::~BasicTaskScheduler()</div><div>  0.00      0.53     0.00   410270     0.00     0.00  MPEG2TransportStreamFramer::updateTSPacketDurationEstimate(unsigned char*, double)</div><div>  0.00      0.53     0.00   326218     0.00     0.00  TimeNow()</div><div>  0.00      0.53     0.00   326217     0.00     0.00  operator-(Timeval const&, Timeval const&)</div><div>  0.00      0.53     0.00   175833     0.00     0.00  OutPacketBuffer::skipBytes(unsigned int)</div><div>  0.00      0.53     0.00   150000     0.00     0.00  HandlerIterator::HandlerIterator(HandlerSet&)</div><div>  0.00      0.53     0.00   150000     0.00     0.00  HandlerIterator::~HandlerIterator()</div></div><br><div class="gmail_quote"><div dir="ltr">сб, 15 июл. 2017 г. в 22:11, Ross Finlayson <<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> I my experience, scalability issues with our server software are usually caused by running up against limits in either (1) the capacity of their network, or (2) the number of open files (sockets) that are supported by the underlying operating system (see <a href="http://live555.com/liveMedia/faq.html#scalability" rel="noreferrer" target="_blank">http://live555.com/liveMedia/faq.html#scalability</a> ).  Increasing this limit usually solves the problem.<br>
><br>
><br>
> I'm using Linux server, so it's not it.<br>
<br>
Note that Linux kernels also have a limit on the number of open files/sockets.  This limit can be reconfigured.<br>
<br>
<br>
> The problem is high CPU usage.<br>
<br>
So which part(s) of the code are contributing most to the CPU usage.  Have you tried rebuilding the code for, and running it under, “gprof”?<br>
<br>
<br>
Ross Finlayson<br>
Live Networks, Inc.<br>
<a href="http://www.live555.com/" rel="noreferrer" target="_blank">http://www.live555.com/</a><br>
<br>
<br>
_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com" target="_blank">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" rel="noreferrer" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small">С уважением, Константин Шпинёв</div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small">ООО "Майкроимпульс"</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small">раб.: +7 (499) 647-49-78</div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small"><div>моб.: +7 (906) 844-57-66</div><div>skype: ksot1k<br><a href="http://www.microimpuls.com/" target="_blank" style="color:rgb(17,85,204)">www.microimpuls.com</a></div></div></div></div></div>