Results 1 to 5 of 5

Thread: VOD file updated while Wowza reads the file

  1. #1
    Join Date
    Nov 2011
    Posts
    14

    Default VOD file updated while Wowza reads the file

    I have a situation where I server 10 VOD files that get updated every hour. They are updated by a shell script. The problem is that Wowza/JDK goes crazy on resources when these file updates begin. I believe the reason is because some users are viewing these files while they are being overwritten.

    My question is:
    Is there any option in config files where I can instruct Wowza to not get upset if a file it's currently reading starts being rewritten by a shell script?

    Thank you in advance for your help!

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    Does the shell script append to the current file or overwrite it? Does the shell script do anything else?

  3. #3
    Join Date
    Nov 2011
    Posts
    14

    Default

    The shell script uses wget to download files from remote system and it overwrites the files.

    Thank you.

  4. #4
    Join Date
    Nov 2011
    Posts
    14

    Default

    Guys, guys, guys, don't fret. I got this!

    I figured out what the problem was. Sometimes, my remote storage would return 0-byte file and my shell script would appropriately replace a fully grown MP4 file with a 0-byte file while Wowza was reading/serving it. Wowza seemed to throw a fit when that would happen, so I'd see CPU/RAM usage start spiking uncontrollably. After I fixed the remote storage system's erratic file serving, I haven't noticed a single bump in Wowza, which tells me that the problem is taken care of. Of course, I could be wrong but so far it's looking good.

    I'll continue monitoring and will update this thread that probably no one is reading :P

    Hope this helps someone in the future!

  5. #5
    Join Date
    Nov 2011
    Posts
    14

    Default

    Another update:

    Even though I worked around the issue, it still threw off Wowza. Upon further investigation, I found that the problem was that when Wowza is reading a VOD file, it doesn't like when you start overwriting the file AS it's reading it. Yes, Wowza is a bit fussy there.

    So the (obvious) solution was to first delete the file that Wowza is reading, wait 2 seconds, then move in new file to that same filename.

    Here's a little bit more detail (sans the code, you should write that yourself for practice anyway):

    A shell script downloads files every hour so that Wowza can always view fresh file. The shell script would previously download the file (using wget) and overwrite the existing filenames that Wowza was looking at (and reading). What I did was I modified the bash script so that it downloads the files to "filename.ts_pending". After the download, the script checks if the _pending file is zero-bytes and only if it's a full working file would it "rm" the existing file and then rename the _pending file by removing the "_pending" part. The trick is doing a "sleep 2" between the "rm" and "mv" commands, so that Wowza has time to stop reading the file and not go nuts.

    I think this will fix it, it's been 2-3 days now and no spikes, hope it stays that way.

    Hope this helps someone else.

Similar Threads

  1. Wowza 4.0.1 VOD streaming error: File is missing 'moov' atom.
    By rkothari in forum On-Demand Streaming
    Replies: 12
    Last Post: 06-30-2015, 01:33 PM
  2. Wowza reads something every 50 minutes
    By unDEFER in forum General Forum
    Replies: 3
    Last Post: 05-03-2013, 01:46 PM
  3. Replies: 1
    Last Post: 05-06-2012, 07:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •