Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

WCS default settings are mostly universal and need to be tuned to certain client case.

Garbage collector tuning

Garbage collector (GC) is an important part of Java VM. When GC is running, it dramatically increases the server load and may stop another tasks execution, therefore it is recommended to minimize GC launch with the following settings in wcs-core.properties file

#Disable heuristic rules
-XX:+UseCMSInitiatingOccupancyOnly

#Reduce Old Gen threshold
-XX:CMSInitiatingOccupancyFraction=70

# Use System.gc() concurrently in CMS
-XX:+ExplicitGCInvokesConcurrent

# Disable System.gc() for RMI, for 10000 hours
-Dsun.rmi.dgc.client.gcInterval=36000000000
-Dsun.rmi.dgc.server.gcInterval=36000000000

Heap memory tuning

Many objects with data are created and destroyed in memory while streaming. Therefore it is recommended to allocate at least 1/2 of server physical memory for Java memory heap. For example, if server RAM is 32 Gb, then it is recommended to allocate 16 Gb with the following settings in wcs-core.properties file

-Xmx16g
-Xms16g

Besides, if REST hooks are not used, the work with memory may be optimized by switching off the interaction between WCS core and WCS manager with the setting in flashphoner.properties file

disable_manager_rmi=true

UDP tuning

Streaming mediadata are transferred with UDP packets. Those packets can be dropped, for example if server does not have enough time to parse packet queue, that leads to picture quality loss and freezes. To escape this it is necessary to tune UDP sockets buffers with the following settings in flashphoner.properties file

rtp_receive_buffer_size=13107200
rtp_send_buffer_size =13107200

and to tune system queues with command

ip link set txqueuelen 2000 dev eth0

To diagnose UDP problem, it is necessary to track UDP packets dropping with command

dropwatch -l kas
>start

Channel load optimization

Users' playback picture quality depends on bitrate: the higher the bitrate, the higher the quality. However, the higher the bitrate, the higher data transfer channel load and, if the bandwidth between the server and clients is limited, there is a possibility that the channel will be fully loaded. This leads the bitrate dropping and a sharp decline in quality.

In this regard, it is necessary to limit the bitrate to ensure sufficient picture quality with an acceptable channel load.

Publisher bitrate limiting

To reduce the load to the channel from publisher to server, maximum and minimum bitrate values in kbps may be set in publisher script with JavaScript API

session.createStream({
    name: streamName,
    display: localVideo,
    constraints: {
        video: {
            minBitrate: 500
            maxBitrate: 1000
        }
    }
    ...
}).publish();

Server bitrate limiting

Minimum and maximum bitrate values in bps on server may be set with the following parameters in flashphoner.properties file

webrtc_cc_min_bitrate=500000
webrtc_cc_max_bitrate=1000000

To exclude fast bitrate rise bu=y browser, the following parameter should be set

webrtc_cc2_twcc=false

Stream decoding on demand only must be switched on to reduce server load:

streaming_video_decoder_fast_start=false
  • No labels