NextPVR Forums
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support v
« Previous 1 2 3 4 5 … 34 Next »
Linux nrecord.log - Commit Log Writes Immediately Not Delayed Buffer Writer

 
  • 0 Vote(s) - 0 Average
Linux nrecord.log - Commit Log Writes Immediately Not Delayed Buffer Writer
LinuxDVR
Offline

Junior Member

USA
Posts: 14
Threads: 3
Joined: Dec 2020
#1
2022-11-12, 06:40 PM (This post was last modified: 2022-11-18, 09:32 PM by LinuxDVR.)
Committed writes of log data to the nrecord.log can be delayed up to 18 hours during inactive periods of the DVR, for example late in the evening until the next evening when recordings begin again. I presume the use of a Buffered Writer object or similar programming object/technique. I haven't noticed buffered data committed to other logs after a delay, but please search the code base for other instances of delayed buffer writes and commit these writes immediately.

Having an incomplete log prevents monitoring and responding quickly to recording errors and similar DVR event monitoring.

I've attached some logs that illustrate the delay, opening the earlier version of the logs you can see a partial truncated line of log info committed at the end of nrecord.log, and the rest of the line and dozens to hundreds more lines of data not showing up for hours until some event triggers more logging activity that presumably exceeds the buffered write threshold and gets the stale data written to the log. I'm using the latest version 6.1.1.221106 Available (6th Nov 2022) on Linux Mint 21(.0 confirmed, the sys info no longer displays minor version number) and the delayed buffer writes have been in place over 1+years of NextPVR releases.


Also, opening the browser TV Guide at http://localhost:8866/guide.html causes the beginning of thousands of log writes lasting well over half an hour to be written to nrecord.log - since these are apparently activities related to just building TV Guide data and Scheduled Recording data and Channel lists for the web browser GUI tabs and/or database table maintenance and not DVR recording activities, I would ask that non-recording logging entries have their own log file like guiinterface.log or dbmaintenance.log rather than clog the nrecord.log. Opening http://localhost:8866/settings.html will generally trigger a few lines of log data that will commit hours-old writes to nrecord.log without triggering the half-hour+ thousands of log lines initiated by opening the guide.html


Attached Files
.zip   logs-20221111-2110.zip (Size: 100.34 KB / Downloads: 2)
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 45,358
Threads: 868
Joined: May 2006
#2
2022-11-12, 07:14 PM
Not knowing what problem you are trying to diagnose makes this difficult to advise but verbose logging turns off the cache.  I have never seen as big a buffer as you describe though so that could be the file system
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 102,418
Threads: 743
Joined: Nov 2003
#3
2022-11-12, 09:25 PM
NextPVR's logging uses several different levels. "error" log messages will cause the logs to flush to disk immediately. Other log messages are not flushed to disk. The 'log files' button in the web app, which is used to collect the log files, will also flush the logs to disk before zipping them up.

NextPVR is fairly verbose with its log messages, and by default it only flush the logs to disk in the scenarios described above, so that the logging doesn't interfere with the smooth operation of other stuff.

If you've got some reason for needing the logs flushed to disk immediately, you can set an NEXTPVR_FLUSH=true environment variable. (or enable verbose mode)

If you want less verbose logging you can change the <LogLevel> setting in config.xml (to INFO or ERROR)
LinuxDVR
Offline

Junior Member

USA
Posts: 14
Threads: 3
Joined: Dec 2020
#4
2022-11-12, 10:36 PM
To enable verbose mode, I didn't find an option in the settings interface, in the config.xml would the setting be <LogLevel>VERBOSE</LogLevel> or how would I enable that? I might try the environment variable as well depending on how much extra logging verbose tracks. Thanks!
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 45,358
Threads: 868
Joined: May 2006
#5
2022-11-12, 10:53 PM
You can add them in /etc/nextpvr-server.conf or something like that.  You seem to monitor DeviceHostLinux and I am not sure what it uses.

Monitoring failures may not be that useful as NextPVR reschedules failures.  Better to find the root causes.  6.1.1 fixed quite a few and only you can fix lock problems


Martin
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 102,418
Threads: 743
Joined: Nov 2003
#6
2022-11-13, 04:36 AM
(2022-11-12, 10:36 PM)LinuxDVR Wrote: To enable verbose mode, I didn't find an option in the settings interface, in the config.xml would the setting be <LogLevel>VERBOSE</LogLevel> or how would I enable that?
For you use, enabling it with <LogLevel>VERBOSE</LogLevel> is probably how you'd have to do that. (I'd probably just set that environment variable instead of the extra logging).

You can enable verbose mode in the UI, but it's usually something we only ask people to turn on for running a specific test, and as such its not a sticky value and would need to be turned on each time it's restarted. You do this by pressing the Ctrl key on the Settings->About page, then a 'Verbose Mode' button appears.
LinuxDVR
Offline

Junior Member

USA
Posts: 14
Threads: 3
Joined: Dec 2020
#7
2022-11-14, 06:20 PM
Thanks both of you, the environment variable works well in server.sh

I didn't know what syntax to add the debugging within the /etc/nextpvr-server.conf - would it be the same <LogLevel>VERBOSE</LogLevel> syntax?

Also, a fresh install of NextPVR in late September defaulted the config.xml entry to <LogLevel>DEBUG</LogLevel> vs VERBOSE, is DEBUG a more detailed log level than Verbose? The DEBUG level does not cause immediate writes (I didn't test VERBOSE in config.xml to see if it wrote log info immediately because I had already seen and implemented the environment variable answer above).

Thanks so much for your assistance!

For others who might reference this thread - I added the following lines to /opt/nextpvr/shell/server.sh

# customization to commit log writes to nrecord.log immediately per https://forums.nextpvr.com/showthread.php?tid=64326
export NEXTPVR_FLUSH=true

just above the main case statement at the bottom of the shell script that begins with

case "$1" in
start) ....etc

You could add the lines within the case statement in only the start and restart cases but case statement syntax is touchy between shell and bash so unintended syntax changes are a bother.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 45,358
Threads: 868
Joined: May 2006
#8
2022-11-14, 06:43 PM
I would have changed the file I recommended.  However note that neither file survive an update

Martin
LinuxDVR
Offline

Junior Member

USA
Posts: 14
Threads: 3
Joined: Dec 2020
#9
2022-11-14, 07:59 PM
(2022-11-14, 06:43 PM)mvallevand Wrote: I would have changed the file I recommended.  However note that neither file survive an update

Martin

What is the actual line to add to /etc/nextpvr-server.conf  to enable the debug logging, is it the same line as config.xml  <LogLevel>VERBOSE</LogLevel> 
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 45,358
Threads: 868
Joined: May 2006
#10
2022-11-14, 08:09 PM
That is for environment variables just safer to edit.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Linux Ending Tuner Recording Early For New Recording Despite Idle Tuners Available LinuxDVR 5 256 2022-11-18, 09:30 PM
Last Post: mvallevand
  Q's about hardware requirements and Linux johnm0101 6 280 2022-11-06, 12:40 PM
Last Post: NumberFive
  Windows and Linux communicating NinthWave 3 488 2021-10-07, 03:50 PM
Last Post: sub
  Can't detect Hauppage 950Q [Linux] thejollyreaper 5 851 2020-08-27, 07:24 PM
Last Post: mvallevand
  NPVR Writes A New Folder Of The Same Name As Existing SamM 9 1,807 2020-07-29, 10:45 PM
Last Post: SamM
  Channel Order on Linux Englishman 13 2,051 2020-06-04, 01:56 AM
Last Post: sub
  How does the Minutes Configuration Next to Live TV Buffer Directory work? aderlopas 8 1,514 2020-01-17, 04:47 PM
Last Post: aderlopas
  EPG /Docker/Linux/Window Paulo 14 3,082 2020-01-14, 11:27 PM
Last Post: Paulo

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode