This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Enable Shared-Cache Mode for opened database #581
Open
haaawk
wants to merge
1
commit into
main
Choose a base branch
from
libsql_shared_cache
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
According to documentation this mode can increase database performance: https://www.sqlite.org/sharedcache.html My tests showed improvement both when using 1 client and 100 clients. For sigle client the throughput increased by 14%. For 100 clients the throughput increased by 27%. On the same time latencies have been lowered. The results for sqld running locally: 1 client with no sharedcache: Summary: Total: 60.0012 secs Slowest: 0.0221 secs Fastest: 0.0009 secs Average: 0.0011 secs Requests/sec: 895.4821 Latency distribution: 10% in 0.0009 secs 25% in 0.0010 secs 50% in 0.0011 secs 75% in 0.0012 secs 90% in 0.0013 secs 95% in 0.0014 secs 99% in 0.0018 secs 1 client with sharedcache: Summary: Total: 60.0008 secs Slowest: 0.0187 secs Fastest: 0.0008 secs Average: 0.0010 secs Requests/sec: 1042.3534 Latency distribution: 10% in 0.0008 secs 25% in 0.0009 secs 50% in 0.0009 secs 75% in 0.0010 secs 90% in 0.0011 secs 95% in 0.0012 secs 99% in 0.0016 secs 100 clients with no sharedcache: Summary: Total: 60.0359 secs Slowest: 0.0962 secs Fastest: 0.0103 secs Average: 0.0368 secs Requests/sec: 2716.9230 Latency distribution: 10% in 0.0311 secs 25% in 0.0338 secs 50% in 0.0368 secs 75% in 0.0396 secs 90% in 0.0422 secs 95% in 0.0439 secs 99% in 0.0480 secs 100 clients with sharedcache: Summary: Total: 60.0218 secs Slowest: 0.0828 secs Fastest: 0.0075 secs Average: 0.0267 secs Requests/sec: 3744.2703 Latency distribution: 10% in 0.0225 secs 25% in 0.0242 secs 50% in 0.0262 secs 75% in 0.0287 secs 90% in 0.0314 secs 95% in 0.0332 secs 99% in 0.0377 secs Signed-off-by: Piotr Jastrzebski <[email protected]>
Single client results with no sharedcache:
Single client results with sharedcache:
100 clients with no sharedcache:
100 clients with sharedcache:
|
I'm about to run benchmarks for writes as well |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to documentation this mode can increase database performance: https://www.sqlite.org/sharedcache.html
My tests showed improvement both when using 1 client and 100 clients.
For sigle client the throughput increased by 14%.
For 100 clients the throughput increased by 27%.
On the same time latencies have been lowered.
The results for sqld running locally:
1 client with no sharedcache:
Summary:
Total: 60.0012 secs
Slowest: 0.0221 secs
Fastest: 0.0009 secs
Average: 0.0011 secs
Requests/sec: 895.4821
1 client with sharedcache:
Summary:
Total: 60.0008 secs
Slowest: 0.0187 secs
Fastest: 0.0008 secs
Average: 0.0010 secs
Requests/sec: 1042.3534
Latency distribution:
10% in 0.0008 secs
25% in 0.0009 secs
50% in 0.0009 secs
75% in 0.0010 secs
90% in 0.0011 secs
95% in 0.0012 secs
99% in 0.0016 secs
100 clients with no sharedcache:
Summary:
Total: 60.0359 secs
Slowest: 0.0962 secs
Fastest: 0.0103 secs
Average: 0.0368 secs
Requests/sec: 2716.9230
Latency distribution:
10% in 0.0311 secs
25% in 0.0338 secs
50% in 0.0368 secs
75% in 0.0396 secs
90% in 0.0422 secs
95% in 0.0439 secs
99% in 0.0480 secs
100 clients with sharedcache:
Summary:
Total: 60.0218 secs
Slowest: 0.0828 secs
Fastest: 0.0075 secs
Average: 0.0267 secs
Requests/sec: 3744.2703
Latency distribution:
10% in 0.0225 secs
25% in 0.0242 secs
50% in 0.0262 secs
75% in 0.0287 secs
90% in 0.0314 secs
95% in 0.0332 secs
99% in 0.0377 secs