SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-07-2016, 03:31 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Profiler Multi-threading

Not having any knowledge of the Profiler code I was just wondering if there is a possibility of having it multi-threaded? The reason I ask is the slow startup. I realize there is the option to postpone the Profiler initialization to get SageTV up and running faster but then the upcoming recordings don't get populated until it is eventually run at some future time.

I notice that when Profiler is initializing a single CPU of my system is pegged until it is completed. Meaning the code runs a single blocking thread until complete. I don't believe that simply postponing this task is enough. Certainly there are other tasks that can only run once the Profiler has completed initialization but is there a reason for completely blocking startup until that point?

Not just that but is it possible for the Profiler initialization code itself to be multi-threaded?
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #2  
Old 11-08-2016, 02:27 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Taddeusz View Post
Not having any knowledge of the Profiler code I was just wondering if there is a possibility of having it multi-threaded? The reason I ask is the slow startup. I realize there is the option to postpone the Profiler initialization to get SageTV up and running faster but then the upcoming recordings don't get populated until it is eventually run at some future time.

I notice that when Profiler is initializing a single CPU of my system is pegged until it is completed. Meaning the code runs a single blocking thread until complete. I don't believe that simply postponing this task is enough. Certainly there are other tasks that can only run once the Profiler has completed initialization but is there a reason for completely blocking startup until that point?

Not just that but is it possible for the Profiler initialization code itself to be multi-threaded?
It's probably possible, since it is sort of job based, building a giant queue of airings, files, and agents, that doesn't really look back in on it's own results - but at the same time, 'startup' is not something that happens all that often in most uses, and maintaining the profiler updates when a show is watched or flagged don't like is a very quick action.

Regarding it blocking, you can't watch any live tv or do any recording until the scheduler is up and running, which is very dependent on carny getting done with what it's doing, so it does need to block. If you are looking to get in and watch something right away, that's exactly what the limited init flag is for.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 11-08-2016, 06:38 AM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
Quote:
Originally Posted by Taddeusz View Post
Not having any knowledge of the Profiler code I was just wondering if there is a possibility of having it multi-threaded? The reason I ask is the slow startup. I realize there is the option to postpone the Profiler initialization to get SageTV up and running faster but then the upcoming recordings don't get populated until it is eventually run at some future time.
I haven't paid attention for a while, but I'm pretty sure the recording schedule is available pretty much immediately on startup, it's just the intelligent recordings that don't show up for a while.
Reply With Quote
  #4  
Old 11-08-2016, 08:58 AM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by stanger89 View Post
I haven't paid attention for a while, but I'm pretty sure the recording schedule is available pretty much immediately on startup, it's just the intelligent recordings that don't show up for a while.
Not sure what changed but I used to have carny init disabled and the recording schedule was always there right away. Now since some time before I upgraded to v9 the profiler init must complete before my upcoming recordings will populate. Disabling carny init leaves it blank till it decides to run.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #5  
Old 11-08-2016, 12:52 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
You want to use carny_limited_init=true to have the fast startup, which means it only calculates Favorite recordings before startup is completed and then does the Intelligent recordings in the background after that.

There's also carny_disable_init=true...which if you set that, then you'll likely have no scheduled recordings at all after startup.

And yes, this code could definitely be multi-threaded...but this would only benefit startup as it already does lots of sleep calls in it to prevent using too much CPU when it's running normally.

I am very much inclined to have it force carny_limited_init to be true if there are a certain number of Agents in the DB so people don't need to worry about setting that....or just do it all the time since I think it's a much bigger complaint to say "Why does it take an hour for SageTV to startup?" rather than "Why does it take hours for Intelligent recording entries to show up?".

Any opinions on that?
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #6  
Old 11-08-2016, 01:52 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by Narflex View Post
You want to use carny_limited_init=true to have the fast startup, which means it only calculates Favorite recordings before startup is completed and then does the Intelligent recordings in the background after that.

There's also carny_disable_init=true...which if you set that, then you'll likely have no scheduled recordings at all after startup.

And yes, this code could definitely be multi-threaded...but this would only benefit startup as it already does lots of sleep calls in it to prevent using too much CPU when it's running normally.

I am very much inclined to have it force carny_limited_init to be true if there are a certain number of Agents in the DB so people don't need to worry about setting that....or just do it all the time since I think it's a much bigger complaint to say "Why does it take an hour for SageTV to startup?" rather than "Why does it take hours for Intelligent recording entries to show up?".

Any opinions on that?
Well crud, looks like I've been mixing up those two options for a long time. I bet I mixed them up when I did a clean install on Windows quite a while ago. Probably a year and a half ago at least. That would explain why I all of a sudden had a problem.

BTW, they are actually disable_carny_init and limited_carny_init.

I would have to agree with you that the limited_carny_init should be defaulted to true. People that have a problem with it can always set it to false. Probably making an Advanced option available in the STV with wording such as "Full Startup Initialization" or "Fast Startup Initialization" so users don't have to dig in the properties file and get confused about those two carny options like I did. Also, since the names of the options are in many cases such as this named after the different internal components of SageTV they aren't necessarily self explanatory to new or nontechnical users.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #7  
Old 11-08-2016, 03:35 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
I see no problem with delaying full processing until after up and running. Certainly would minimize worry about really long startups, leading to people forcing close the app. Perhaps it might warrant an icon when the full processing is going on, similar to the media scan icon, to perhaps help explain to users why their intelligent recordings are all of a sudden not happening after they just restarted to update a plugin, etc.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #8  
Old 11-09-2016, 01:47 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
OK, I changed the default in the code...this will only affect new installs though since it won't override an existing setting.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transcoder multi-threading working for anyone? blade SageTV Beta Test Software 4 12-24-2008 03:40 PM
Multi-Disc DVD Profiler Import Brent SageMC Custom Interface 17 12-22-2008 05:54 PM
Would Sage benefit from multi-core, multi cpu configurations? kamikaze2112 Hardware Support 10 09-26-2008 09:13 AM
Is SageTV set up for multi-threading? redsuntrading SageTV Software 3 10-11-2007 11:42 AM
XP Patch: A Crash Occurs In Ks.sys On PC's With Intel Hyper-Threading CPU Mark Lamutt Hardware Support 1 08-11-2003 12:06 AM


All times are GMT -6. The time now is 01:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.