Giter Site home page Giter Site logo

Comments (6)

erankor avatar erankor commented on May 18, 2024 1

Mapped mode probably won't help, to clarify regarding the different modes, the choice of modes is usually:

  1. 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
  2. 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
  3. 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:

  1. 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.
  2. 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)
  3. 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
  4. 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
  5. Enable gzip compression on manifest responses - gzip_types application/vnd.apple.mpegurl video/f4m application/dash+xml text/xml
  6. Apply common nginx performance best practices, such as tcp_nodelay=on, client_header_timeout etc.

Hope this helps

from nginx-vod-module.

kaltura-hooks avatar kaltura-hooks commented on May 18, 2024

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.

erankor avatar erankor commented on May 18, 2024

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.

 avatar commented on May 18, 2024

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.

 avatar commented on May 18, 2024

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.

 avatar commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.