Hi -

I just downloaded the sources, as http://sqlite.org/arch.html
didn't really say much about the journal or multi-processing.

It appears from looking at pager.c that every process working
with a database acquires its own page cache by use of read().
They independently keep their individual cache in sync by
playing back the (single) journal.

So if you configure a max cache size of M, and you have
N persistent processes on a machine, eventually you'll likely
get to a N * M total usage of RAM for cache?

I can see that this allows for independent readers while one
process is writing.
But this is at the cost of redundant cache misses, as each
reader must do the same reading to refill its cache.
I realize that disk pages are likely cached by the OS (in RAM
too, after the first processes reads it).
So it is likely not to be redundant real disk IO.
But it seems like it uses more RAM than it might, if there
are multiple persistent processes and a decent sized cache.

I realize that alternative architectures add significant
complexity: for example, a shared set of pages with shadow
versions to maintain transactional isolation, and reference
tracking to age away unused pages.
(That is, some variant of MVCC.)

But is my understanding of the tradeoff correct?

-mda



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to