{"id":390677,"date":"2024-06-29T09:23:03","date_gmt":"2024-06-29T09:23:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=390677"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=390677","title":{"rendered":"<span>Turning RTSP into WebRTC: how many cameras will the server withstand?<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/352\/743\/f65\/352743f652e9371f9315939378b6e080.jpg\" width=\"1024\" height=\"637\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/352\/743\/f65\/352743f652e9371f9315939378b6e080.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>This article continues the series of articles on load tests. Today we will analyze the testing methodology and answer the question: &#171;How many IP cameras can be connected to a WebRTC server?&#187; <\/p>\n<p>Why connect IP cameras to the server? For example, in order to make a simple video surveillance system that broadcasts what&#8217;s happening in front of the cameras to the website. Of all the variety of IP cameras, we are interested in those instances that transmit video streams over the RTSP protocol. The fact is that browsers don&#8217;t know how to play RTSP streams directly, so <a href=\"https:\/\/flashphoner.com\/how-to-cook-rtsp-on-your-website-in-2020-or-why-the-boars-will-not-have-a-chance-to-run-away\/\">to add video from an IP camera to your website<\/a>, you need to turn an RTSP video stream from an IP camera into WebRTC. And if everything is more or less clear from the  <a href=\"https:\/\/flashphoner.com\/7-ways-to-stream-rtsp-on-the-page\/\">article<\/a>, with the software implementation, then at the stage of implementing the solution, the question will definitely appear: <\/p>\n<p>&#171;What kind of server do we need and how many cameras can we connect to it?&#187;<\/p>\n<p>Let&#8217;s get started. <\/p>\n<h3>Testing Plan<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/32b\/25a\/ab5\/32b25aab500b2b92936d2e2b3fe5d49e.png\" width=\"746\" height=\"464\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/32b\/25a\/ab5\/32b25aab500b2b92936d2e2b3fe5d49e.png\"\/><figcaption><\/figcaption><\/figure>\n<ol>\n<li>\n<p>Publish VOD stream on the WCS#1 server;<\/p>\n<\/li>\n<li>\n<p>Using a script that uses REST requests, publish RTSP streams on the WCS#2 server; <\/p>\n<\/li>\n<li>\n<p>Choose a random RTSP stream on WCS#2 and visually evaluate the stream;<\/p>\n<\/li>\n<li>\n<p>Estimate the load on the WCS#2 server by the metrics values collected by the Prometheus monitoring system for the WCS#2 server.<\/p>\n<\/li>\n<\/ol>\n<p>Testing is considered successful if we can connect 1,000 IP cameras and no degradation of streams is seen in the monitoring results or visually.<\/p>\n<h3>Test bench<\/h3>\n<p>For testing, we need<\/p>\n<ul>\n<li>\n<p>two WCS servers;<\/p>\n<\/li>\n<li>\n<p>script for the test;<\/p>\n<\/li>\n<\/ul>\n<p>We assume that you already have WCS servers installed and configured. If not, install them according to <a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Quick+deployment+and+testing+of+the+server\">this instruction<\/a>, make <a href=\"https:\/\/flashphoner.com\/what-kind-of-server-do-you-need-to-run-a-thousand-webrtc-streams\/\">tweaks to boost performance<\/a> and connect to <a href=\"https:\/\/flashphoner.com\/10-important-webrtc-streaming-metrics-and-configuring-prometheus-grafana-monitoring\/\">monitoring<\/a>. <\/p>\n<p>We used two servers for testing:<\/p>\n<p><strong>WCS#1 (testing)<\/strong> with characteristics:<\/p>\n<ul>\n<li>\n<p>24 cores, 48 streams;<\/p>\n<\/li>\n<li>\n<p>128 Gb RAM;<\/p>\n<\/li>\n<li>\n<p>WCS 5.2.958;<\/p>\n<\/li>\n<li>\n<p>OpenJDK version 14.0.1<\/p>\n<\/li>\n<\/ul>\n<p>and<\/p>\n<p><strong>WCS#2 (tested)<\/strong> with characteristics:<\/p>\n<ul>\n<li>\n<p>12 cores, 24 streams;<\/p>\n<\/li>\n<li>\n<p>96 Gb RAM;<\/p>\n<\/li>\n<li>\n<p>WCS 5.2.958;<\/p>\n<\/li>\n<li>\n<p>OpenJDK version 14.0.1<\/p>\n<\/li>\n<\/ul>\n<h4>Server Settings<\/h4>\n<p>File <a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Settings+file+flashphoner.properties\">flashphoner.properties<\/a> (w\/o default settings):<\/p>\n<pre><code class=\"bash\">#webrtc ports range media_port_from = 20001 media_port_to = 40000  #websocket ports ws.port=8080 wss.port=8443  rtsp_activity_timer_timeout=86400000  wcs_agent_port_from=44001 wcs_agent_port_to=55000  global_bandwidth_check_enabled=true zgc_log_parser_enable=true zgc_log_time_format=yyyy-MM-dd'T'HH:mm:ss.SSSZ  rtsp_port_from=55001 rtsp_port_to=65000<\/code><\/pre>\n<p>Here we increased the range of ports for WebRTC, RTSP and WCS agent. We increased the timeout for RTSP streams without subscribers, and also specified settings for collecting additional metrics for network congestion and pauses in ZGC operation.<\/p>\n<p>For the testing server, we added additional settings for VOD \u2014  cyclic stream capture and setting the duration of the VOD stream publication after disconnecting subscribers:<\/p>\n<pre><code class=\"bash\">vod_live_loop=true vod_stream_timeout=14400000<\/code><\/pre>\n<p>File <a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Settings+file+wcs-core.properties\">wcs-core.properties<\/a> (w\/o default settings):<\/p>\n<pre><code class=\"bash\">-XX:ErrorFile=\/usr\/local\/FlashphonerWebCallServer\/logs\/error%p.log  # ZGC -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms24g -Xmx24g -XX:+UseLargePages -XX:ZPath=\/hugepages  -Xlog:gc*:\/usr\/local\/FlashphonerWebCallServer\/logs\/gc-core-:time<\/code><\/pre>\n<p>Here we changed the settings for naming log files, enabled the use of ZGC, adjusted the Heap size, and enabled the use of memory pages.<\/p>\n<p>Full versions of the configuration files can be downloaded from the Useful Files section at the bottom of the article. There you will also find a panel for Grafana and a script file to start testing.<\/p>\n<h4>Test Script<\/h4>\n<pre><code class=\"bash\">#! \/bin\/bash camera=1000  curl -X POST -H 'Content-type: application\/json' --data \"{\\\"uri\\\":\\\"vod-live:\/\/bunny720p-test.mp4\\\", \\\"localStreamName\\\":\\\"test\\\"}\" \"http:\/\/localhost:8081\/rest-api\/vod\/startup\"  sleep 5s  for i in `seq 1 $camera`; do   curl --data \"{\\\"uri\\\":\\\"rtsp:\/\/172.16.40.2:554\/test?\"$i\"\\\",\\\"toStream\\\":\\\"RTSP-test-stream\"$i\"\\\"}\" -X POST -H 'Content-type: application\/json'  -s http:\/\/172.16.40.3:8081\/rest-api\/rtsp\/startup   sleep 0.1s done<\/code><\/pre>\n<p>where:<\/p>\n<ul>\n<li>\n<p><strong>camera<\/strong> \u2014 number of emulated RTSP streams.<\/p>\n<\/li>\n<\/ul>\n<p>We will use 720p video in our tests. More video parameters are shown in the screenshot below:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f40\/e8c\/967\/f40e8c967870fd596152718f1da0e203.png\" width=\"1356\" height=\"279\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f40\/e8c\/967\/f40e8c967870fd596152718f1da0e203.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>Testing<\/h3>\n<p>On the testing WCS#1 server, run the script for testing:<\/p>\n<pre><code class=\"bash\">.\/RTSP-load-test.sh<\/code><\/pre>\n<p>Test result for 1,000 captured RTSP streams: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/efa\/81e\/5f5\/efa81e5f5b14318823285eac97c92ef4.PNG\" width=\"1406\" height=\"804\"\/><figcaption><\/figcaption><\/figure>\n<p>The test was successful. No stream degradation was recorded by metrics. The CPU load according to the Load average 1 metric did not exceed 100 units.<\/p>\n<p>Open the standard example Player on the tested WCS#2 server and start playing a random RTSP stream from the captured ones:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cf8\/9bf\/83a\/cf89bf83a7364931cfa121520c8c33ff.PNG\" width=\"858\" height=\"747\"\/><figcaption><\/figcaption><\/figure>\n<p>The control stream is played with acceptable quality \u2014 no freezing, artifacts and sound quality degradation.<\/p>\n<p>We ran some more tests<\/p>\n<p>for 1,500 RTSP streams: <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a21\/6d2\/884\/a216d288406b389a451f3852f502c988.PNG\" width=\"1408\" height=\"817\"\/><figcaption><\/figcaption><\/figure>\n<p>and for 2,000 RTSP streams:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/012\/75d\/862\/01275d862a0f5d0784f38c74870faed4.PNG\" width=\"1415\" height=\"810\"\/><figcaption><\/figcaption><\/figure>\n<p>The results of these tests show an increase in the CPU load and an increase in pauses in ZGC. Metrics show no stream degradation, but the control stream is played with noticeable artifacts. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cd6\/eb9\/97a\/cd6eb997a20431d6a7fde8efab503080.png\" width=\"856\" height=\"754\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cd6\/eb9\/97a\/cd6eb997a20431d6a7fde8efab503080.png\"\/><figcaption><\/figcaption><\/figure>\n<p>As you can see, the tests were not very long. Therefore, you cannot make a decision on choosing a server for a video surveillance system based solely on these tests. Indeed, in the long term, the behavior of the system can change.<\/p>\n<p>Let&#8217;s run another test with 1,000 captured RTSP streams:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/645\/67a\/f13\/64567af130f2557e0cac615a55f1cc67.PNG\" width=\"1413\" height=\"812\"\/><figcaption><\/figcaption><\/figure>\n<p>This test lasted nearly two hours. During this time, you can see that there are no critical changes in resource utilization. The control stream was also played correctly all the time:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/15d\/b95\/7a7\/15db957a7a32c17d3030430de9fe2642.png\" width=\"858\" height=\"747\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/15d\/b95\/7a7\/15db957a7a32c17d3030430de9fe2642.png\"\/><figcaption><\/figcaption><\/figure>\n<p>We remind you that the test results directly depend on the environment, therefore, they may be better or worse when tested on your hardware. <\/p>\n<p>Have a good streaming!<\/p>\n<h3>Useful Files<\/h3>\n<p>Panel for Grafana:<\/p>\n<p> <a href=\"https:\/\/flashphoner.com\/wp-content\/uploads\/2021\/07\/RTSP-720p-testing.json\"><u>RTSP-720p-testing.json<\/u><\/a>  <\/p>\n<p>WCS Settings:<\/p>\n<p> <a href=\"https:\/\/flashphoner.com\/wp-content\/uploads\/2021\/07\/flashphoner.properties\"><u>flashphoner.properties<\/u><\/a><\/p>\n<p><a href=\"https:\/\/flashphoner.com\/wp-content\/uploads\/2021\/07\/wcs-core.properties\">wcs-core.properties<\/a><\/p>\n<p>Test Script:<\/p>\n<p><a href=\"https:\/\/flashphoner.com\/wp-content\/uploads\/2021\/07\/RTSP-load-test.sh\"><u>RTSP-load-test.sh<\/u><\/a> <\/p>\n<h3>Links<\/h3>\n<p><a href=\"https:\/\/demo.flashphoner.com\/admin\/login.html\">Demo<\/a><\/p>\n<p><a href=\"https:\/\/flashphoner.com\/amazon-ec2-support-in-web-call-server\">WCS on Amazon EC2<\/a><\/p>\n<p><a href=\"https:\/\/flashphoner.com\/web-call-server-on-digital-ocean-marketplace\">WCS on DigitalOcean<\/a><\/p>\n<p><a href=\"https:\/\/flashphoner.com\/support-web-call-server-in-docker\">WCS in Docker<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Settings+file+flashphoner.properties\">Settings file flashphoner.properties<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Settings+file+wcs-core.properties\">Settings file wcs-core.properties<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Server+tuning+recommendations\">Server tuning recommendations<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Memory+management+in+Java\">Memory management in Java<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Before+moving+to+production\">Before moving to production<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Quick+deployment+and+testing+of+the+server\">Quick deployment and testing of the server<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Load+and+resource+usage+information\">Load and resource usage information<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Connecting+from+Prometheus\">Monitoring with Prometheus<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/REST+API\">REST API<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/From+an+IP+camera+via+RTSP\">Stream capturing from an IP camera via RTSP<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/570370\/\"> https:\/\/habr.com\/ru\/articles\/570370\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>This article continues the series of articles on load tests. Today we will analyze the testing methodology and answer the question: &#171;How many IP cameras can be connected to a WebRTC server?&#187; <\/p>\n<p>Why connect IP cameras to the server? For example, in order to make a simple video surveillance system that broadcasts what&#8217;s happening in front of the cameras to the website. Of all the variety of IP cameras, we are interested in those instances that transmit video streams over the RTSP protocol. The fact is that browsers don&#8217;t know how to play RTSP streams directly, so <a href=\"https:\/\/flashphoner.com\/how-to-cook-rtsp-on-your-website-in-2020-or-why-the-boars-will-not-have-a-chance-to-run-away\/\">to add video from an IP camera to your website<\/a>, you need to turn an RTSP video stream from an IP camera into WebRTC. And if everything is more or less clear from the  <a href=\"https:\/\/flashphoner.com\/7-ways-to-stream-rtsp-on-the-page\/\">article<\/a>, with the software implementation, then at the stage of implementing the solution, the question will definitely appear: <\/p>\n<p>&#171;What kind of server do we need and how many cameras can we connect to it?&#187;<\/p>\n<p>Let&#8217;s get started. <\/p>\n<h3>Testing Plan<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<ol>\n<li>\n<p>Publish VOD stream on the WCS#1 server;<\/p>\n<\/li>\n<li>\n<p>Using a script that uses REST requests, publish RTSP streams on the WCS#2 server; <\/p>\n<\/li>\n<li>\n<p>Choose a random RTSP stream on WCS#2 and visually evaluate the stream;<\/p>\n<\/li>\n<li>\n<p>Estimate the load on the WCS#2 server by the metrics values collected by the Prometheus monitoring system for the WCS#2 server.<\/p>\n<\/li>\n<\/ol>\n<p>Testing is considered successful if we can connect 1,000 IP cameras and no degradation of streams is seen in the monitoring results or visually.<\/p>\n<h3>Test bench<\/h3>\n<p>For testing, we need<\/p>\n<ul>\n<li>\n<p>two WCS servers;<\/p>\n<\/li>\n<li>\n<p>script for the test;<\/p>\n<\/li>\n<\/ul>\n<p>We assume that you already have WCS servers installed and configured. If not, install them according to <a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Quick+deployment+and+testing+of+the+server\">this instruction<\/a>, make <a href=\"https:\/\/flashphoner.com\/what-kind-of-server-do-you-need-to-run-a-thousand-webrtc-streams\/\">tweaks to boost performance<\/a> and connect to <a href=\"https:\/\/flashphoner.com\/10-important-webrtc-streaming-metrics-and-configuring-prometheus-grafana-monitoring\/\">monitoring<\/a>. <\/p>\n<p>We used two servers for testing:<\/p>\n<p><strong>WCS#1 (testing)<\/strong> with characteristics:<\/p>\n<ul>\n<li>\n<p>24 cores, 48 streams;<\/p>\n<\/li>\n<li>\n<p>128 Gb RAM;<\/p>\n<\/li>\n<li>\n<p>WCS 5.2.958;<\/p>\n<\/li>\n<li>\n<p>OpenJDK version 14.0.1<\/p>\n<\/li>\n<\/ul>\n<p>and<\/p>\n<p><strong>WCS#2 (tested)<\/strong> with characteristics:<\/p>\n<ul>\n<li>\n<p>12 cores, 24 streams;<\/p>\n<\/li>\n<li>\n<p>96 Gb RAM;<\/p>\n<\/li>\n<li>\n<p>WCS 5.2.958;<\/p>\n<\/li>\n<li>\n<p>OpenJDK version 14.0.1<\/p>\n<\/li>\n<\/ul>\n<h4>Server Settings<\/h4>\n<p>File <a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Settings+file+flashphoner.properties\">flashphoner.properties<\/a> (w\/o default settings):<\/p>\n<pre><code class=\"bash\">#webrtc ports range media_port_from = 20001 media_port_to = 40000  #websocket ports ws.port=8080 wss.port=8443  rtsp_activity_timer_timeout=86400000  wcs_agent_port_from=44001 wcs_agent_port_to=55000  global_bandwidth_check_enabled=true zgc_log_parser_enable=true zgc_log_time_format=yyyy-MM-dd'T'HH:mm:ss.SSSZ  rtsp_port_from=55001 rtsp_port_to=65000<\/code><\/pre>\n<p>Here we increased the range of ports for WebRTC, RTSP and WCS agent. We increased the timeout for RTSP streams without subscribers, and also specified settings for collecting additional metrics for network congestion and pauses in ZGC operation.<\/p>\n<p>For the testing server, we added additional settings for VOD \u2014  cyclic stream capture and setting the duration of the VOD stream publication after disconnecting subscribers:<\/p>\n<pre><code class=\"bash\">vod_live_loop=true vod_stream_timeout=14400000<\/code><\/pre>\n<p>File <a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Settings+file+wcs-core.properties\">wcs-core.properties<\/a> (w\/o default settings):<\/p>\n<pre><code class=\"bash\">-XX:ErrorFile=\/usr\/local\/FlashphonerWebCallServer\/logs\/error%p.log  # ZGC -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms24g -Xmx24g -XX:+UseLargePages -XX:ZPath=\/hugepages  -Xlog:gc*:\/usr\/local\/FlashphonerWebCallServer\/logs\/gc-core-:time<\/code><\/pre>\n<p>Here we changed the settings for naming log files, enabled the use of ZGC, adjusted the Heap size, and enabled the use of memory pages.<\/p>\n<p>Full versions of the configuration files can be downloaded from the Useful Files section at the bottom of the article. There you will also find a panel for Grafana and a script file to start testing.<\/p>\n<h4>Test Script<\/h4>\n<pre><code class=\"bash\">#! \/bin\/bash camera=1000  curl -X POST -H 'Content-type: application\/json' --data \"{\\\"uri\\\":\\\"vod-live:\/\/bunny720p-test.mp4\\\", \\\"localStreamName\\\":\\\"test\\\"}\" \"http:\/\/localhost:8081\/rest-api\/vod\/startup\"  sleep 5s  for i in `seq 1 $camera`; do   curl --data \"{\\\"uri\\\":\\\"rtsp:\/\/172.16.40.2:554\/test?\"$i\"\\\",\\\"toStream\\\":\\\"RTSP-test-stream\"$i\"\\\"}\" -X POST -H 'Content-type: application\/json'  -s http:\/\/172.16.40.3:8081\/rest-api\/rtsp\/startup   sleep 0.1s done<\/code><\/pre>\n<p>where:<\/p>\n<ul>\n<li>\n<p><strong>camera<\/strong> \u2014 number of emulated RTSP streams.<\/p>\n<\/li>\n<\/ul>\n<p>We will use 720p video in our tests. More video parameters are shown in the screenshot below:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>Testing<\/h3>\n<p>On the testing WCS#1 server, run the script for testing:<\/p>\n<pre><code class=\"bash\">.\/RTSP-load-test.sh<\/code><\/pre>\n<p>Test result for 1,000 captured RTSP streams: <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>The test was successful. No stream degradation was recorded by metrics. The CPU load according to the Load average 1 metric did not exceed 100 units.<\/p>\n<p>Open the standard example Player on the tested WCS#2 server and start playing a random RTSP stream from the captured ones:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>The control stream is played with acceptable quality \u2014 no freezing, artifacts and sound quality degradation.<\/p>\n<p>We ran some more tests<\/p>\n<p>for 1,500 RTSP streams: <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>and for 2,000 RTSP streams:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>The results of these tests show an increase in the CPU load and an increase in pauses in ZGC. Metrics show no stream degradation, but the control stream is played with noticeable artifacts. <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>As you can see, the tests were not very long. Therefore, you cannot make a decision on choosing a server for a video surveillance system based solely on these tests. Indeed, in the long term, the behavior of the system can change.<\/p>\n<p>Let&#8217;s run another test with 1,000 captured RTSP streams:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>This test lasted nearly two hours. During this time, you can see that there are no critical changes in resource utilization. The control stream was also played correctly all the time:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>We remind you that the test results directly depend on the environment, therefore, they may be better or worse when tested on your hardware. <\/p>\n<p>Have a good streaming!<\/p>\n<h3>Useful Files<\/h3>\n<p>Panel for Grafana:<\/p>\n<p> <a href=\"https:\/\/flashphoner.com\/wp-content\/uploads\/2021\/07\/RTSP-720p-testing.json\"><u>RTSP-720p-testing.json<\/u><\/a>  <\/p>\n<p>WCS Settings:<\/p>\n<p> <a href=\"https:\/\/flashphoner.com\/wp-content\/uploads\/2021\/07\/flashphoner.properties\"><u>flashphoner.properties<\/u><\/a><\/p>\n<p><a href=\"https:\/\/flashphoner.com\/wp-content\/uploads\/2021\/07\/wcs-core.properties\">wcs-core.properties<\/a><\/p>\n<p>Test Script:<\/p>\n<p><a href=\"https:\/\/flashphoner.com\/wp-content\/uploads\/2021\/07\/RTSP-load-test.sh\"><u>RTSP-load-test.sh<\/u><\/a> <\/p>\n<h3>Links<\/h3>\n<p><a href=\"https:\/\/demo.flashphoner.com\/admin\/login.html\">Demo<\/a><\/p>\n<p><a href=\"https:\/\/flashphoner.com\/amazon-ec2-support-in-web-call-server\">WCS on Amazon EC2<\/a><\/p>\n<p><a href=\"https:\/\/flashphoner.com\/web-call-server-on-digital-ocean-marketplace\">WCS on DigitalOcean<\/a><\/p>\n<p><a href=\"https:\/\/flashphoner.com\/support-web-call-server-in-docker\">WCS in Docker<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Settings+file+flashphoner.properties\">Settings file flashphoner.properties<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Settings+file+wcs-core.properties\">Settings file wcs-core.properties<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Server+tuning+recommendations\">Server tuning recommendations<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Memory+management+in+Java\">Memory management in Java<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Before+moving+to+production\">Before moving to production<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Quick+deployment+and+testing+of+the+server\">Quick deployment and testing of the server<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Load+and+resource+usage+information\">Load and resource usage information<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/Connecting+from+Prometheus\">Monitoring with Prometheus<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/REST+API\">REST API<\/a><\/p>\n<p><a href=\"https:\/\/docs.flashphoner.com\/display\/WCS52EN\/From+an+IP+camera+via+RTSP\">Stream capturing from an IP camera via RTSP<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/570370\/\"> https:\/\/habr.com\/ru\/articles\/570370\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-390677","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/390677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=390677"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/390677\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=390677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=390677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=390677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}