Allow admin to set journal_size_limit to set wal file size limit #3953

Open
opened 2026-02-28 03:46:16 -05:00 by deekerman · 1 comment
Owner

Originally created by @cfouche3005 on GitHub (Feb 4, 2025).

🏷️ Feature Request Type

Settings

🔖 Feature description

On some cloud provider (eg Fly.io) volume size are extremely limited (eg 1GB).
The problem with sqlite is that although the db size is very small (the issue is written with the v2 context and the new aggregated tables), the wal file can grow to unreasonable size (especially after VACUUM operations).
This behavior is not a bug but a feature of the WAL of sqlite as explained in the sqlite documentation
The problem is that (as specified in section 6 of the WAL documentation), the wal file is not truncated after a checkpoint unless journal_size_limit is set (see this). By default it's set to -1 (no limit)

✔️ Solution

Expose and option to set the journal_size_limit on all of the sqlite databases used by Uptime-Kuma ( PRAGMA schema.journal_size_limit = N ; only set the journal_size_limit for a db not the entire file and I don't know if uptime-kuma use multiple database in one file, ether way, this option should be set to all db).
This option doesn't need to be in the ui, it can be an env variable or an option in the db config file

Alternatives

No response

📝 Additional Context

No response

Originally created by @cfouche3005 on GitHub (Feb 4, 2025). ### 📑 I have found these related issues/pull requests - https://github.com/louislam/uptime-kuma/issues/4995 - https://github.com/louislam/uptime-kuma/issues/5114 ### 🏷️ Feature Request Type Settings ### 🔖 Feature description On some cloud provider (eg Fly.io) volume size are extremely limited (eg 1GB). The problem with sqlite is that although the db size is very small (the issue is written with the v2 context and the new aggregated tables), the wal file can grow to unreasonable size (especially after VACUUM operations). This behavior is not a bug but a feature of the WAL of sqlite as explained in the sqlite [documentation](https://www.sqlite.org/wal.html) The problem is that (as specified in section 6 of the WAL documentation), the wal file is not truncated after a checkpoint unless journal_size_limit is set (see [this](https://www.sqlite.org/pragma.html#pragma_journal_size_limit)). By default it's set to -1 (no limit) ### ✔️ Solution Expose and option to set the journal_size_limit on all of the sqlite databases used by Uptime-Kuma ( [PRAGMA schema.journal_size_limit = N ;](https://www.sqlite.org/pragma.html#pragma_journal_size_limit) only set the journal_size_limit for a db not the entire file and I don't know if uptime-kuma use multiple database in one file, ether way, this option should be set to all db). This option doesn't need to be in the ui, it can be an env variable or an option in the db config file ### ❓ Alternatives _No response_ ### 📝 Additional Context _No response_
Author
Owner

@CommanderStorm commented on GitHub (Apr 15, 2025):

setting this statically to something reasonably large is something that I would merge.
I don't think that something this specsific needs a configuration option

What do you tthink?

@CommanderStorm commented on GitHub (Apr 15, 2025): setting this statically to something reasonably large is something that I would merge. I don't think that something this specsific needs a configuration option What do you tthink?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#3953
No description provided.