Skip to content

ovsqlite: add mmapsize configuration#337

Closed
kev009 wants to merge 1 commit into
InterNetNews:mainfrom
kev009:ovsqlite-mmap-size
Closed

ovsqlite: add mmapsize configuration#337
kev009 wants to merge 1 commit into
InterNetNews:mainfrom
kev009:ovsqlite-mmap-size

Conversation

@kev009
Copy link
Copy Markdown
Contributor

@kev009 kev009 commented Apr 29, 2026

No description provided.

@Julien-Elie Julien-Elie self-assigned this May 4, 2026
@Julien-Elie Julien-Elie added enhancement New feature or request C: overview Related to overview methods P: low Low priority labels May 4, 2026
@Julien-Elie Julien-Elie added this to the 2.7.4 milestone May 4, 2026
@Julien-Elie
Copy link
Copy Markdown
Contributor

Thanks!
I'll commit it soon.

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request May 7, 2026
@Julien-Elie
Copy link
Copy Markdown
Contributor

A good starting value is the size of the database file or the amount of available memory, whichever is smaller.

Is it safe to recommend to set the amount of available memory? It may starve the server. Shouldn't something be said about that?
I read in https://www.sqlite.org/mmap.html that performance does not always increase with memory-mapped I/O, and that any I/O error on a memory-mapped file cause a signal which, if not caught by the application, results in a program crash.
Maybe the SQL requests we use all behave faster with mmap, so we're not in the above performance caveat.

@kev009
Copy link
Copy Markdown
Contributor Author

kev009 commented May 20, 2026

Yes it is generally safe to mmap any sized file (subject to virtual address space limitations, on i.e. 32b). The kernel will page in and out the file as needed so the fixed memory use at any point is low. In a multi-process architecture it is ideal, i.e. ovsqlite-server and nnrpd direct readers.

Of the caveats, the Unified Buffer Cache one is the only critical and applies to all the other places inn uses mmap. It is not the right syscall for ZFS because they never correctly integrated it with any OS memory management.

Julien-Elie added a commit that referenced this pull request May 20, 2026
@kev009 kev009 deleted the ovsqlite-mmap-size branch May 20, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: overview Related to overview methods enhancement New feature or request P: low Low priority

2 participants