Skip to content

feat: Add support for an SQLite cache as a low-memory option - #14

Merged
aklinker1 merged 4 commits into
mainfrom
sqlite-cache-refactor
Oct 1, 2026
Merged

aklinker1 merged 4 commits into
mainfrom
sqlite-cache-refactor

Conversation

@aklinker1

@aklinker1 aklinker1 commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

The service is dying all the time because it's running on a 1 vCPU, 1GB RAM machine. Instead of upgrading and paying more, I'm going to move the cache into SQLite so it uses disk space (which I have a lot of) instead of memory.

The process runs OOM, an new one is started, and it loops. Each color is a different container.

image

The type of cache is controlled by env vars, so I'll post resullts after it's been released.

Also, thrown errors are now cached and rethrown for the TTL. Before, if there was an error, it would try to fetch the latest value again and fail again, which is slow.

@aklinker1 aklinker1 self-assigned this Oct 1, 2026
@aklinker1
aklinker1 added this pull request to stack #16 October 1, 2026 22:44
@aklinker1
aklinker1 merged commit e7229ab into main Oct 1, 2026
2 checks passed
@aklinker1
aklinker1 deleted the sqlite-cache-refactor branch October 1, 2026 22:46
@aklinker1

aklinker1 commented Oct 1, 2026 •

Copy link
Copy Markdown
Member Author

Didn't really help, went right back up after loading the WXT homepage.

image

I think the memory usage comes from the dataloader cache. Will remove from there, or follow their advice and create an instance per-request.

image

@aklinker1

Copy link
Copy Markdown
Member Author

Oh, but it's not permanent like before... interesting. after a few minutes memory usage went down, until I loaded wxt.dev again.

image

That means it could just be the number of HTML pages I'm holding in memory while crawling everything. The data loader just stores some small JSON snippets. I should fix that bug, but that's definitely not the main problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant