[Live-devel] live555MediaServer performance improvement
Hi, When I testing the RTSP server live555MediaServer then I faced slow performance. On one core of the CPU with a clock speed of about 3.2 Gz it is possible to process only about 140 client connections. The search for information on the mailing lists indicated the following ways of optimization: 1. Develop own TaskScheduler. I tried using the epoll library, but I ran into the problem that the epoll does not support regular files (and I need to stream files via RTSP), so I had to use the select to process read events from the file and didn't achieve any performance improvements. 2. Improve DelayQueue. Can anyone share the code? Can someone suggest more ways to improve performance and share the code? -- С уважением, Константин Шпинёв ООО "Майкроимпульс" раб.: +7 (499) 647-49-78 моб.: +7 (906) 844-57-66 skype: ksot1k www.microimpuls.com ___ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel
Re: [Live-devel] live555MediaServer performance improvement
> > > 2. Improve DelayQueue. Can anyone share the code? > To my knowledge, nobody has ever suggested that the implementation of the > “DelayQueue” class needs to be improved (and, to my knowledge, the current > implementation has no problems at all). So that’s completely a ‘red > herring’. > > About slow DelayQueue: http://git.net/ml/multimedia.live555.devel/2007-06/msg00010.html > 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 > http://live555.com/liveMedia/faq.html#scalability ). Increasing this > limit usually solves the problem. > > I'm using Linux server, so it's not it. The problem is high CPU usage. > > Ross Finlayson > Live Networks, Inc. > http://www.live555.com/ > > > ___ > live-devel mailing list > live-devel@lists.live555.com > http://lists.live555.com/mailman/listinfo/live-devel > -- С уважением, Константин Шпинёв ООО "Майкроимпульс" раб.: +7 (499) 647-49-78 моб.: +7 (906) 844-57-66 skype: ksot1k www.microimpuls.com ___ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel
Re: [Live-devel] live555MediaServer performance improvement
40 clients, ~40% CPU usage. gprof results: Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds secondscalls us/call us/call name 20.76 0.11 0.11 15 0.73 3.47 BasicTaskScheduler::SingleStep(unsigned int) 11.32 0.17 0.0661120 0.98 1.04 DelayQueue::addEntry(DelayQueueEntry*) 9.43 0.22 0.0558657 0.85 1.36 RTPInterface::sendPacket(unsigned char*, unsigned int) 7.55 0.26 0.0458296 0.69 0.69 DelayQueue::removeEntry(long) 5.66 0.29 0.0358611 0.51 0.51 MultiFramedRTPSink::buildAndSendPacket(unsigned char) 3.77 0.31 0.02 3231064 0.01 0.01 HandlerIterator::next() 3.77 0.33 0.02 326217 0.06 0.06 DelayQueue::synchronize() 3.77 0.35 0.02 15 0.13 0.18 DelayQueue::handleAlarm() 3.77 0.37 0.02 117586 0.17 0.17 NetInterfaceTrafficStats::countPacket(unsigned int) 3.77 0.39 0.0258610 0.34 0.34 SimpleRTPSink::doSpecialFrameHandling(unsigned int, unsigned char*, unsigned int, timeval, unsigned int) 3.77 0.41 0.0258610 0.34 2.91 MultiFramedRTPSink::sendPacketIfNecessary() 3.77 0.43 0.0258610 0.34 3.76 MPEG2TransportStreamFramer::afterGettingFrame1(unsigned int, timeval) 1.89 0.44 0.01 15 0.07 0.12 DelayQueue::timeToNextAlarm() 1.89 0.45 0.01 117222 0.09 0.09 FramedSource::getNextFrame(unsigned char*, unsigned int, void (*)(void*, unsigned int, unsigned int, timeval , unsigned int), void*, void (*)(void*), void*) 1.89 0.46 0.01 116338 0.09 0.17 BasicTaskScheduler::setBackgroundHandling(int, int, void (*)(void*, int), void*) 1.89 0.47 0.0190105 0.11 0.11 HandlerIterator::reset() 1.89 0.48 0.0161120 0.16 1.21 BasicTaskScheduler0::scheduleDelayedTask(long, void (*)(void*), void*) 1.89 0.49 0.0158658 0.17 0.17 writeSocket(UsageEnvironment&, int, in_addr, unsigned short, unsigned char*, unsigned int) 1.89 0.50 0.0158610 0.17 3.42 MultiFramedRTPSink::afterGettingFrame1(unsigned int, unsigned int, timeval, unsigned int) 1.89 0.51 0.0158151 0.17 0.17 HandlerDescriptor::~HandlerDescriptor() 1.89 0.52 0.01 22 454.56 454.56 MultiFramedRTPSink::MultiFramedRTPSink(UsageEnvironment&, Groupsock*, unsigned char, unsigned int, char cons t*, unsigned int) 1.89 0.53 0.01 BasicTaskScheduler::~BasicTaskScheduler() 0.00 0.53 0.00 410270 0.00 0.00 MPEG2TransportStreamFramer::updateTSPacketDurationEstimate(unsigned char*, double) 0.00 0.53 0.00 326218 0.00 0.00 TimeNow() 0.00 0.53 0.00 326217 0.00 0.00 operator-(Timeval const&, Timeval const&) 0.00 0.53 0.00 175833 0.00 0.00 OutPacketBuffer::skipBytes(unsigned int) 0.00 0.53 0.00 15 0.00 0.00 HandlerIterator::HandlerIterator(HandlerSet&) 0.00 0.53 0.00 15 0.00 0.00 HandlerIterator::~HandlerIterator() сб, 15 июл. 2017 г. в 22:11, Ross Finlayson : > > 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 > http://live555.com/liveMedia/faq.html#scalability ). Increasing this > limit usually solves the problem. > > > > > > I'm using Linux server, so it's not it. > > Note that Linux kernels also have a limit on the number of open > files/sockets. This limit can be reconfigured. > > > > The problem is high CPU usage. > > 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”? > > > Ross Finlayson > Live Networks, Inc. > http://www.live555.com/ > > > ___ > live-devel mailing list > live-devel@lists.live555.com > http://lists.live555.com/mailman/listinfo/live-devel > -- С уважением, Константин Шпинёв ООО "Майкроимпульс" раб.: +7 (499) 647-49-78 моб.: +7 (906) 844-57-66 skype: ksot1k www.microimpuls.com ___ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel
Re: [Live-devel] live555MediaServer performance improvement
> > Also, I notice - from the “gprof” output - that you are streaming > Transport Stream files. Are those the only kinds of files that you are > streaming? Is there anything noteworthy/special about them, or are they > just regular Transport Stream files (e.g. containing H.264 video and AAC > audio)? > > Yes. Yes, it is regular TS-files with H.264 and AAC. Do you think It can make a difference? Perhaps there is a way to increase the buffer size so that there are fewer read / write operations, and as a consequence fewer operations in the event loop / queue? -- С уважением, Константин Шпинёв ООО "Майкроимпульс" раб.: +7 (499) 647-49-78 моб.: +7 (906) 844-57-66 skype: ksot1k www.microimpuls.com ___ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel
Re: [Live-devel] Video from ip camera by private protocol.
Здравствуйте! Я нахожусь в режиме отпуска с 12.03.18 по 23.03.18. Скорее всего я не увижу это письмо, когда вернусь к работе. Для решения Вашего вопроса, пожалуйста, обратитесь к моим коллегам по контактам, указанным ниже, в зависимости от темы вопроса. * * * * * Техническая поддержка, что-то не работает или работает не так: supp...@microimpuls.com Планирование, сроки, вопросы по проектам: напишите, пожалуйста, своему менеджеру, а если это я - позвоните. Технические вопросы по продуктам Microimpuls и разработке Smarty и интеграции: Александр Ларин, ala...@microimpuls.com Приложения для приставок, Smart TV: Татьяна Москалёва, truet...@microimpuls.com Мобильные приложения: Дим Бикмуллин, d...@microimpuls.com Видео-серверы (Транскодинг, PVR, Стриминг): Александр Ларин, ala...@microimpuls.com Коммерческие вопросы Общие: cont...@microimpuls.com Redbox: redbox.sa...@microimpuls.com Плюс ТВ: Светлана Яруллина, f...@microimpuls.com Вопросы от кабельных операторов: m...@microimpuls.com Вопросы по доставке сигнала и стримингу: m...@microimpuls.com Технические вопросы по услугам доставки и стримингу: o...@microimpuls.com Контент и настройки каналов: m...@microimpuls.com Маркетинг: Владислав Федосеенко, vlad.fedosee...@microimpuls.com Административные вопросы: m...@microimpuls.com Вопросы публикации приложений в маркеты: Татьяна Москалёва, truet...@microimpuls.com Impuls TV и другие TV-сервисы Microimpuls: Татьяна Москалёва, truet...@microimpuls.com Другое: m...@microimpuls.com * * * * * Если Ваше письмо требует исключительно моего ответа, то, пожалуйста, отправьте мне это письмо позже. Благодарю за понимание! ___ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel