# Database Cache Size Behavior Question

**URL:** <https://forums.plex.tv/t/database-cache-size-behavior-question/822657>\
**Category:** Plex Media Server\
**Tags:** server-freebsd\
**Created:** [December 13, 2022, 11:23pm UTC](https://forums.plex.tv/t/database-cache-size-behavior-question/822657 "2022-12-13T23:23:17Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [December 15, 2022, 10:30pm UTC](https://forums.plex.tv/t/database-cache-size-behavior-question/822657/7 "2022-12-15T22:30:15Z")

</div>

And a few more for comparison.

Again I acknowledge that this isn’t the same as being _inside_ Plex. 🙂

This is all `speedtest1`, new files each time, varying the **page\_size** and **cache\_size** only.

```auto
# Variants of this command:
rm testfile.db ; ./speedtest1 --size 200 --journal WAL --pagesize 1024 --cachesize 2000 testfile.db | grep TOTAL

```

```auto
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.

---

_[View the full topic](https://forums.plex.tv/t/database-cache-size-behavior-question/822657)._
