Database Cache Size Behavior Question

And a few more for comparison.

Again I acknowledge that this isn’t the same as being inside Plex. :slight_smile:

This is all speedtest1, new files each time, varying the page_size and cache_size only.

# Variants of this command:
rm testfile.db ; ./speedtest1 --size 200 --journal WAL --pagesize 1024 --cachesize 2000 testfile.db | grep TOTAL
1024, 2000 = 2048000
       TOTAL.......................................................   55.506s
1024, 4000 = 4096000
       TOTAL.......................................................   37.873s
1024, 8000 = 8192000
       TOTAL.......................................................   28.760s
1024, 16000 = 16384000
       TOTAL.......................................................   25.225s
1024, 32000 = 32768000
       TOTAL.......................................................   23.631s


4096, 500 = 2048000
       TOTAL.......................................................   40.840s
4096, 1000 = 4096000
       TOTAL.......................................................   26.579s
4096, 2000 = 8192000
       TOTAL.......................................................   19.361s
4096, 4000 = 16384000
       TOTAL.......................................................   16.785s
4096, 8000 = 32768000
       TOTAL.......................................................   16.000s


8192, 250 = 2048000
       TOTAL.......................................................   43.045s
8192, 500 = 4096000
       TOTAL.......................................................   27.014s
8192, 1000 = 8192000
       TOTAL.......................................................   18.549s
8192, 2000 = 16384000
       TOTAL.......................................................   15.743s
8192, 4000 = 32768000
       TOTAL.......................................................   14.958s


16384, 125 = 2048000
       TOTAL.......................................................   50.152s
16384, 250 = 4096000
       TOTAL.......................................................   30.167s
16384, 500 = 8192000
       TOTAL.......................................................   19.542s
16384, 1000 = 16384000
       TOTAL.......................................................   15.579s
16384, 2000 = 32768000
       TOTAL.......................................................   14.589s


32768, 62 = 2031616
       TOTAL.......................................................   68.670s
32768, 125 = 4096000
       TOTAL.......................................................   39.802s
32768, 250 = 8192000
       TOTAL.......................................................   22.690s
32768, 500 = 16384000
       TOTAL.......................................................   16.824s
32768, 1000 = 32768000
       TOTAL.......................................................   15.124s

I observe the same catastrophe you mentioned. Very large page_size values, with constrained total cache_size, behave very poorly indeed.

But at page_size of 4096, while maintaining the same total cache_size, increasing page_size is a big win.

in synthetic tests.

I see your last comment. Please know how much I appreciate you sharing the information you’ve shared.