high cpu usage

Gabriel T

Member
Hello
on a quadcore, 64gb ram ubuntu server, 1 video stream with 1 connected user makes the cpu 20%...
2 videos streams, 30% cpu
3 videos streams 50% cpu
im a bit scared to start a production app with such figures...is this normal behavior ?
 

Max

Administrator
Staff member
High CPU usage can be caused by
1. Trial license and audio transcoding.
Because it inserts audio watermarks to the streams.
2. Old version.
We did some optimizations in latest versions of server.
3. Transcoding.
If you pass width and height params on playback
Example
Code:
session.createStream({name:'stream1', constraints:{audio:true,video:{width:640,height:480}}}).play();
4. Transcoding
When you use different codecs on publishing and playback ends.
For example: publishing WebRTC VP8, playback H.264 MSE.
5. Decoding.
WCS enables video decoding by default for all streams.
You can disable this feature to improve CPU usage:
Code:
streaming_video_decoder_fast_start=false
6. Wrong measuring.
Could you provide screenshot of 'top' command output?
Generally you see percent per logical CPU, not per server.
So if you have 1 CPU, 4 cores with hyper-threading, you have 4 x 2 = 8 logical CPU.
Therefore you see load 30% of 1 logical CPU.
Therefore 0.3 / 8 = 0.0375 = 4% of physical CPU.
 

Gabriel T

Member
hello

thank you for reply

i will take a look at the settings, here is my properties file:

ip =xxx
ip_local =xxx
port_from =30000
port_to =31000
media_port_from =31001
media_port_to =32000
waiting_answer =60
user_agent =Flashphoner/1.0
balance_header =balance
cost_header =cost
video_enabled =true
domain =
outbound_proxy =
outbound_port =
log_level =5
enable_context_logs =false
rtp_activity_detecting =true,60
sip_msg_listener =com.flashphoner.sdk.sip.ChangeCallIdListener
call_record_listener =com.flashphoner.server.client.DefaultCallRecordListener
dtmf =rfc2833
auto_login_url =/usr/local/FlashphonerWebCallServer/conf/account.xml
get_callee_url =/usr/local/FlashphonerWebCallServer/conf/callee.xml
codecs =opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,vp8,h264,flv,mpv
codecs_exclude_sip =mpeg4-generic,flv,mpv
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp =opus,g729,g722,mpeg4-generic,vp8,mpv
on_record_hook_script =on_record_hook.sh
rtmp_transponder_stream_name_prefix =
rtmp_transponder_full_url=false
 
Top