nginx-hls-module icon indicating copy to clipboard operation
nginx-hls-module copied to clipboard

cpu usage recomendations

Open arty777 opened this issue 10 years ago • 10 comments

config example my location /hdd81/ { add_header Cache-Control "private, no-store, no-cache, must-revalidate"; hls; hls_length 20; # length of fragment (seconds) hls_mp4_buffer_size 5M; hls_mp4_max_buffer_size 30M; root /raid/; }

very big , 100% cpu usage , 2 Gigabit channal wor on 30% ...

can you please give some recomendations how to reduse cpu utilization ? may be hls_length 20; set bigger ? 100 for example

arty777 avatar Sep 30 '14 06:09 arty777

what processor are you using ?

ankurss avatar Sep 30 '14 09:09 ankurss

1 server 2*Six-Core AMD Opteron(tm) Processor 2427 model name : Six-Core AMD Opteron(tm) Processor 2427 stepping : 0 cpu MHz : 2200.000

2 server model name : Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz

3rd 2* model name : Intel(R) Xeon(R) CPU L5630 @ 2.13GHz

i see that hls_length 50; against hls_length 10; resolve my problem with cpu ,,, 50% utilization now

arty777 avatar Sep 30 '14 09:09 arty777

now i see memory problem ,,, try find decision

for example each nginx1 process (whole 8) get 1.1 GB memory ... hls_length 50; # length of fragment (seconds) hls_mp4_buffer_size 256k; hls_mp4_max_buffer_size 5M;

arty777 avatar Sep 30 '14 09:09 arty777

i disable keep alive , and all fine with memory , but with cpu is still bad

arty777 avatar Sep 30 '14 11:09 arty777

What can give advice to reduce the load on the CPU?

arty777 avatar Sep 30 '14 14:09 arty777

@rounce cpu is a big bottleneck of this module :( i can't utilize 4GB channel (read from ramdisk) 100% cpu

in a small load - works well

arty777 avatar Sep 30 '14 18:09 arty777

with all respect, but I don't think it has anything to do with this module. We are using the module on Cortex A9 dual core (ARM) CPU and it is running smoothly even chunking complete feature movies on the fly. This cpu has only a fraction of the performance of the cpu you are using. So most likely you have some other bottleneck somewhere.

marcelpoelstra avatar Sep 30 '14 18:09 marcelpoelstra

@thevideoxpress it all depends on the load you are probably very little load the, a small number of users, I have for example while watching videos 5,000 active users in the same time (with pseudo streaming work fine)

arty777 avatar Sep 30 '14 19:09 arty777

In that case you'd better use one (ore more) extra nginx machines as reverse proxy in front of your origin server. In that case all video's will only have to be chunked once, incl m3u8 generation, since any next request of the same file will be served from cache and does not need to go through this module again.

marcelpoelstra avatar Sep 30 '14 19:09 marcelpoelstra

@rounce i hope you wil do something to reduce cpu utilization,

thank you

arty777 avatar Sep 30 '14 19:09 arty777