![]() |
|
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. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Any details around the Database Improvements?
From the release notes:
21. Significant performance improvements to overall database system My wiz.bin hovers between 80 - 90MB lately and I am noticing some performance issues especially on the extenders.I want to try the Open Source version specifically for this update but am afraid of some of my installed plugins might then have issues. It would be nice to know the details of this update to see if it would even be worth trying it out... Are there any specifics regarding this?
__________________
If this doesn't work right, Then: "I'm going to blow up the Earth!" |
#2
|
||||
|
||||
Quote:
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#3
|
|||
|
|||
What is locking and concurrency exactly when it comes to STV?
__________________
Will OS: Windows 7 Hardware: Intel Core i7-920 with 12GB RAM & an Adaptec 5805 with a Chenbro 36-port SAS Expander Case: Antec 1200 with 4 iStarUSA trayless hot-swap cages (20 drives max) Drives: 8 Toshiba/Hitachi 2TB drives in a RAID 6 & 7 Toshiba 3TB drives in a RAID 6 Capture Cards: HDHomeRun Connect Quatro 4, Hauppauge 60 HD-PVR Players: 5 HD300s, 2 HD200s |
#4
|
|||
|
|||
Basically it means it improves allowing multiple things to access the database at once. Locking = preventing other things from accessing the database while it's doing something. Concurrency = multiple things accessing it at once.
So - before it was possible that if the server was updating something in one part of the database - it could have made any clients wanting to read stuff wait until it was done even if there wasn't any overlap in the areas the two things were looking at. I'm assuming he's improved the code so if the server is writing something related to item A and the client wants to read information about item B it won't have to wait until the server is done. I don't know the specifics of what was slow before or what was improved - but this is my best guess :-). |
#5
|
|||
|
|||
There are also indexes that contained ID's sorted by something else. So when looking up something like a show by its title, the program doesn't have to scan all of the shows (which are in the order they were initially added to the DB). It instead can quickly locate the title by searching the index and checking only a few ID's to find the right one. If you want more detail I can make an illustration.
|
#6
|
||||
|
||||
The improvements were pretty much all concurrency related. Previously, it had locks per-table. So if something was reading/writing the Airing table...then nothing else could access it at the same time. Now each table has separate locks for reading and writing...so many things are allowed to read a table in the DB simultaneously; and they are only blocked out that table DB if something has a write lock (which we only grab now when something is actually being modified). A main point of slowdown previously was after an EPG update when SageTV was saving out the database to disk and had to read the whole thing from memory to write it out, locking each table as it was written...and that took a fair amount of time and you'd usually see the spinning circle during this...now it should not cause the spinning circle at all since it will only be grabbing read locks.
Sorted indexes were always part of the database. ![]() The other improvement was adding Lucene; so that when you do full text searches, they will execute much faster than before (although they already worked surprisingly fast for doing a linear search of the DB).
__________________
Jeffrey Kardatzke Founder of SageTV |
#7
|
|||
|
|||
That's odd because when I disassemble my version 7 DB, there aren't any.
|
#8
|
||||
|
||||
Quote:
![]()
__________________
Jeffrey Kardatzke Founder of SageTV |
#9
|
|||
|
|||
Quote:
Code:
// 83 added support for writing out index orders; this is backwards compatible since older versions will skip this section and create their own indices ![]() |
#10
|
||||
|
||||
Quote:
![]()
__________________
Jeffrey Kardatzke Founder of SageTV |
#11
|
||||
|
||||
I just cleared the watched flag of about 12,000 recordings using the WebUI and though that would shrink my wiz.biin down a bit but it did not. In fact it went form 81,302KB to 86,273KB. Is there some sort of process that I need to do to purge old recordings without starting from a completely fresh wiz.bin?
__________________
If this doesn't work right, Then: "I'm going to blow up the Earth!" |
#12
|
||||
|
||||
What ever you do with the wiz.bin it won't have an immediate effect on the size. You need to wait for the cleanup to occur. Normally happens on a SageTV restart or daily when doing an EPG update.
Something I have seen is UserRecords created by plugins taking up wiz.bin space as there is not an automated process to delete the UserRecords associated with a media file when the file is deleted. John |
#13
|
||||
|
||||
Quote:
__________________
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 |
#14
|
||||
|
||||
Some of my plugins are guilty of this. I think we need a PluginUninstalled event so plugins can clean up after themselves when uninstalled.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#15
|
||||
|
||||
Quote:
![]() In addition to user records, mediafiles have custom metadata fields. Phoenix stuffs LOTS of information in these fields.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#16
|
||||
|
||||
So whenever I record something or set something to watched it is going to stay in the wiz.bin forever?
I give up... I'm ditching my wiz.bin and starting fresh. The only thing that sucks is that I have a couple of odl classic favorite TV shows that I'm trying to get and now it will end up recording the ones I already have again. No biggie...
__________________
If this doesn't work right, Then: "I'm going to blow up the Earth!" |
#17
|
|||
|
|||
On the face of it I guess it's not bad that SageTV loads the entire db into memory. However, I can see how this can be a problem as one's database grows larger. An 80MB database shouldn't necessarily be a problem. A more pragmatic approach using a cache might be better approach. Why should the whole database always be kept in memory when the majority of that database won't necessarily need to be accessed?
Yes, accessing data from disk would take more time than from memory but smart cache management could make any user impact negligible. For example, as someone is scrolling through the recordings list or through the videos list it could pre-cache the items forward and backward on the list as the user is scrolling. That way the user should never notice any interface impact from a cache miss. Even if/when SageTV can run in a 64-bit JVM in Windows that 80MB database is still taking up a significant part of its overall memory footprint. Another school of thought I just had is the current database format is kind of akin to the old legacy Office document formats. For those that don't know a .doc file is actually a dump of the memory representation of that document to disk. So when Word loads a .doc file it essentially plays back that file into memory. This is the reason that the legacy Office files can grow so huge compared to the newer format based on XML. Not saying the current wiz.bin is necessarily a bad thing. It has most definitely served its purpose. Just thinking that even as difficult as it would be to change a more pragmatic approach might be necessary to continue to move SageTV into the future. I'm not saying lets replace the Wizard just because. From an efficiency and maintainability perspective how much of the code is written specifically to deal with maintenance of the Wizard? Garbage collection, concurrency, locking? How often does this code run? How much more efficient could the core of SageTV be if we were to use a standard database, even something like SQLite or Mongo? I'm sure there are libraries already that can convert database objects to the Java objects that SageTV uses with little to no fuss. Yes, this would introduce necessary complexity. But it would also offload some of the maintenance of the database itself to a system specifically designed to store and manage data. Not saying "let's do this". I know the Wizard is Jeff's baby. Just providing some perspective and food for thought.
__________________
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 |
#18
|
||||
|
||||
Quote:
__________________
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 |
#19
|
|||
|
|||
Quote:
![]() http://forums.sagetv.com/forums/showthread.php?t=62512 |
#20
|
||||
|
||||
Quote:
FWIW, since the beginning I've seen lots of people wanting to "improve" the Sage database, but rarely, if ever, have I seen anyone provide evidence of an actual problem with Sage's current database, performance or otherwise. It all seems largely academic/philosophical, people assume because it's not a standard format it's not good or something. FWIW2, 80MB is nothing these days, I've got 80MB pictures. Last edited by stanger89; 10-02-2015 at 09:15 AM. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Limit to Day - V7 Improvements? | bellyman | SageTV Software | 10 | 09-27-2011 04:34 PM |
EPG Thread : Questions, Improvements, etc | bialio | Phoenix | 2 | 06-26-2011 05:55 AM |
Improvements needed for Sage TV HD | Flash2k6 | SageTV HD Theater - Media Player | 7 | 12-04-2009 07:03 PM |
Clear QAM Improvements to HVR-1600 | bcjenkins | SageTV Linux | 1 | 11-14-2009 09:13 AM |
general improvements | loomdog32 | SageMC Custom Interface | 0 | 12-25-2008 10:30 PM |