Comments (6)
Mapped mode probably won't help, to clarify regarding the different modes, the choice of modes is usually:
- If you don't have the mp4 files locally, then you use remote mode, an example of such a scenario is a CDN working in origin-pull mode
- If you have the files and you don't need any custom logic to map the playback URL to the mp4 file path, use local mode
- Otherwise, if you want to have some remote server decide on the file path of the mp4 that should be used for a certain request, use mapped mode
Back to your problem, it's hard for me to provide specific guidelines without a full understanding of the setup or the ability to debug it, but I can provide the following generic performance guidelines for using nginx-vod-module:
- Unless you have a small scale deployment, don't have users play the videos directly from nginx-vod-module - for medium scale add a layer of caching proxies between the vod module and the end users (can use standard nginx servers with proxy_pass & proxy_cache). For large scale deployments, I would recommend using a CDN (such as Akamai, Level3 etc.). Since all the different streaming protocols supported by nginx vod are HTTP based, they can be cached by standard HTTP proxies / CDNs. Also, in general, it's best to have nginx vod as close as possible to where the mp4 files are stored, and have the caching proxies as close as possible to the end users.
- Enable caches on the nginx-vod server:
a. vod_moov_cache - saves the need to re-read the video metadata for each segment. This cache should be rather large, we currently use 4GB and we get about 90% hit ratio.
b. vod_response_cache - saves the responses of manifest requests, may not be required if you have a second layer of caching servers before nginx vod. This cache does not to be too large, 128M is probably more than enough for most deployments.
c. vod_path_mapping_cache - for mapped mode only, few MBs is usually enough
d. nginx's open_file_cache - caches open file handles
You can check the effectiveness of these caches by enabling performance counters (vod_performance_counters) and setting up a status page for nginx vod (vod_status) - In local & mapped modes, enable aio. Support for aio has to be compiled to nginx, and it then has to be enabled in nginx conf (aio on). You can verify it works by looking at the performance counters on the vod status page - read_file vs. async_read_file
- In local & mapped modes, enable asynchronous file open - nginx has to be compiled with threads support and then vod_open_file_thread_pool has to be specified. You can verify it works by looking at the performance counters on the vod status page - open_file vs. async_open_file
- Enable gzip compression on manifest responses - gzip_types application/vnd.apple.mpegurl video/f4m application/dash+xml text/xml
- Apply common nginx performance best practices, such as tcp_nodelay=on, client_header_timeout etc.
Hope this helps
from nginx-vod-module.
Hi @sergiyshutov,
Thank for you reporting an issue and helping improve Kaltura!
To get the fastest response time, and help the maintainers review and test your reported issues or suggestions, please ensure that your issue includes the following (please comment with more info if you have not included all this info in your original issue):
- Is the issue you're experiencing consistent and across platforms? or does it only happens on certain conditions?
please provide as much details as possible. - Is Nginx installed from the kaltura-nginx RPM or deb package?
When using RPM, paste the output for:
# rpm -qa kaltura-nginx
For deb based systems:
# dpkg -l kaltura-nginx
-
If the issue is with the install process, please provide full output of the apt-get/yum install command.
-
If you compiled Nginx on your own, please provide the output for:
$ uname -a $ gcc -v
If using a compiler other than GCC, please provide exact name and version.
Also, provide the configure line you used. -
Check Nginx error logs and provide relevant output
If you only have a general question rather than a bug report, please close this issue and post at:
http://forum.kaltura.org
Thank you in advance,
from nginx-vod-module.
Local = the mp4 is read from a file, can be either local disk or some NFS mount. When working with NFS it is highly recommended to use asynchronous I/O (nginx has to be compiled with aio support and it also has to be enabled in nginx.conf)
Remote = the mp4 is fetched using HTTP range requests from some remote server. Note that the full video metadata (=mp4 moov atom) is required for every request, so it is highly recommended to configure a large enough moov cache (vod_moov_cache). In the case of video/audio frame data, on the other hand, only the minimum subset that is relevant to the specific segment is fetched.
Mapped = the mp4 is read from a file (like Local), but a remote server performs the mapping between the request URI and the actual file path. So, nginx-vod-module initially performs an HTTP request to some upstream, gets a file path in response, and continues with the flow of local mode using the path received from the remote server.
Regarding load balancing, it's not part of this module, on our production environment, for example, we have several nginx servers running nginx-vod-module in mapped mode and serving files from a shared NFS storage. These servers are behind an F5/Big Ip load balancer.
from nginx-vod-module.
In storage server i need use Local mode and other server Mapped?
Can you please give example config with mapped mode.
Thanks :)
from nginx-vod-module.
Sorry. Can you please give example nginx config in storage server and Mapped server? I mean how to use this between 2 and more servers :)
from nginx-vod-module.
Because i have problematic situation right now. I have one server in hetzner 16gb ram, port 1gb (200 mbps guaranteed). Nginx installed with vod module and https://github.com/vozlt/nginx-module-vts. In status page i have this: active connections: 500, reg per second 40-60, and server start lag. So, what i need to make? one more storage server or i can play with mapped mode or something like that?
Thank you very much :)
from nginx-vod-module.
Related Issues (20)
- Segment type HOT 1
- MKV Lacing HOT 2
- MP4 is seen as WebM HOT 3
- Watch time ? HOT 1
- different DRM encryption keys for different videos under HLS HOT 2
- Subtitle without a DEFAULT=YES, AUTOSELECT=YES HOT 13
- Proxy to already encrypted widevine mpd dash streams
- Does the nginx-vod-module support ClearKey with an external key server for HLS and DASH? HOT 4
- Does this package use ffmpeg for Repackaging? HOT 5
- something in each request with CDN HOT 2
- Schedule live stream from mp4 HOT 12
- Error compiling nginx-vod-module with nginx-1.24.0 HOT 2
- Centos7 vs Almalinux8 (Centos8) Kaltura packages repo
- Video shifts on auto quality hls change HOT 1
- HLS playback fails when using the master playlist HOT 1
- How does it work?
- Audio sync to external audio track
- Thumbnails in interlaced video with vod_thumb_accurate_positioning off
- Non-stop loading of repetitive segments HOT 1
- Multiple audio tracks in one segment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-vod-module.