I do not have clear examples to post  on this but would like to report
findings around multi threaded read access (single process) in a large
system that uses sqlite.

This may be a known issue/restriction of memory sqlite behaviour, but
wanted to check with the list first:

1. Running 2, 3, ... 6 multi threaded readers of a single *memory *sqlite
database (via shared cache mode) on an 8 core cpu shows no throughput gain
at all compared to single threaded throughput. In fact, it shows a
throughput drop: i.e. if a single thread can do N simple queries/sec, 2
threads .. up to 6 threads do a little less (10% drop) in total. This
suggests that access to memory sqlite can only be serialized?

2. Running the same example on sqlite *file *(multi threaded mode; WAL
journal) scales almost linearly;  so 6 threads provide nearly 6xN
throughput. Single threaded throughput is a bit slower (around 15-20%)
than single threaded in-memory access (expected).

So, memory sqlite is not really usable with multiple threads (readers).
While one might expect  that multiple readers of *memory *content could
scale even better than with file content.

Can this restriction be lifted?
Is there some special mode possible to achieve scaling up throughput with
multiple threads for memory sqlite content?

sqlite-users mailing list

Reply via email to