Bug 18082 - Allow custom input to Database Memory Config
: Allow custom input to Database Memory Config
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: unspecified
: PC Windows 7
: -- enhancement with 1 vote (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-05 17:06 UTC by Sander
Modified: 2014-07-26 16:36 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sander 2014-04-05 17:06:18 UTC
In the current LMS setup users can opt to increase the memory allocated the sqlite buffer by going to Settings-Advanced-Performance-Memory Config and from the combobox they can select Normal or High.
Based on my understanding this triggers the following code in SQLiteHelper.pm

 # Wweak some memory-related pragmas if dbhighmem is enabled
        if ( $prefs->get('dbhighmem') ) {
                # Default cache_size is 2000 pages, a page is normally 1K but may be different
                # depending on the OS/filesystem.  So default is usually 2MB.
                # Highmem we will try 20M
                push @{$sql}, 'PRAGMA cache_size = 20000';

                # Default temp_store is to create disk files to save memory
                # Highmem we'll let it use memory
                push @{$sql}, 'PRAGMA temp_store = MEMORY';
        }

Based on some threads in Squeezebox Forums, notably:
http://forums.slimdevices.com/showthread.php?93260-Optimizing-to-use-more-memory&highlight=sqlitehelper

I have changed the PRAGMA cache_size by a factor of 100 with a noticeable increase in performance. It would be great if we could add the ability to manually tweak this value through the Web UI as opposed to changing this in the code.
Comment 1 Michael Herger 2014-05-02 15:18:49 UTC
(In reply to comment #0)
> I have changed the PRAGMA cache_size by a factor of 100 with a noticeable
> increase in performance. It would be great if we could add the ability to
> manually tweak this value through the Web UI as opposed to changing this in
> the code.

Where did you see the biggest performance improvement?
Comment 2 Michael Herger 2014-05-02 15:20:41 UTC
I created a small plugin which does, among other things, allow setting the cache_buffer value dynamically from the web UI:

http://forums.slimdevices.com/showthread.php?101469-Plugin-to-test-database-tweaks

Depending on the outcome of some tests by users of this plugin I'm probably going to implement parts of it in LMS.
Comment 3 Sander 2014-07-26 16:36:46 UTC
Thanks Michael!