Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

high cpu consumtion for 100 calls #18

Open
vijaykumarameyo opened this issue Jan 17, 2020 · 3 comments
Open

high cpu consumtion for 100 calls #18

vijaykumarameyo opened this issue Jan 17, 2020 · 3 comments

Comments

@vijaykumarameyo
Copy link

for 100 calls it using 3 cores. can we optimize it for the same?

@traud
Copy link
Owner

traud commented Jan 18, 2020

Welcome to GitHub! The authors of Opus Codec have an FAQ for this.

(1) The first thing you should double-check: Do you need the bitrate and channels?

(2) If that does not help, you are able to play around with the complexity. That can be changed in the file codec_opus_open_source.c in the method opus_encoder_construct. Add

status = opus_encoder_ctl(opvt->opus, OPUS_SET_COMPLEXITY(0));

for example after the code line OPUS_SET_DTX. Zero is the lowest complexity. If that helped already, go up in complexity until you are happy.

(3) However, the most reduction is done when no transcoding and just pass-through happens. For this, double-check why both call legs require transcoding at all.

If all this did not help, please, look out for a qualified computer scientist who knows about CPU profiling. He is able to identify hot spots and/or peaks in your installation and can provide advice.

@vijaykumarameyo
Copy link
Author

@traud thank you for the response.

As I am testing it on load setup with transcoding, playing wav file on opus negotiated channels, with complexity 5 and bitrate auto (-1000) by setting for application VoIP.
status = opus_encoder_ctl(opvt->opus, OPUS_SET_COMPLEXITY(5));
so here is transcoding happening for slin to opus (same as slin to alaw translation cost as per core show translation).
but the load is so high compared to alaw transcoding over 100 calls.
so my doubt is, is it normal behavior or there is something wrong in optimization or tweaking?

@traud
Copy link
Owner

traud commented Jan 21, 2020

is it normal behavior

I cannot comment on this because in my setup I have exactly one call in transcoding, at maximum. 100 calls and 3 cores sound reasonable. Nevertheless, I am sure there is room for optimization.

same as slin to alaw translation cost

Not sure why you mention the translation cost table. Just to avoid any possible misunderstanding, the values in that table are not absolute but relative. They indicate the best route for the originating audio codec. For example, for Opus Codec, slin is the shortest route. You cannot compare one value for G.711 with a value for Opus Codec. The values are just about to find the best route.

playing wav file

I recommend to play around not with auto but the bitrate you need. I recommend to start with the lowest complexity. I recommend to go through that FAQ one by one. And I recommend to look into creating audio files in Opus Codec, if transcoding happens to WAV files is you biggest bottleneck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants