Skip to content

Commit 063d174

Browse files
committed
Tune SQLite pragmas for each db
Using values inspired by Litestack
1 parent 0f8b7a0 commit 063d174

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

config/database.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,26 @@ development:
1717
primary:
1818
<<: *default
1919
database: storage/development/data.sqlite3
20+
pragmas:
21+
mmap_size: <%= 128 * 1024 * 1024 %> # 128MB
2022
cache:
2123
<<: *default
2224
database: storage/development/cache.sqlite3
2325
migrations_paths: db/migrate_cache
26+
pragmas:
27+
mmap_size: <%= 64 * 1024 * 1024 %> # 64MB
2428
queue:
2529
<<: *default
2630
database: storage/development/queue.sqlite3
2731
migrations_paths: db/migrate_queue
32+
pragmas:
33+
mmap_size: <%= 64 * 1024 * 1024 %> # 64MB
2834
cable:
2935
<<: *default
3036
database: storage/development/cable.sqlite3
3137
migrations_paths: db/migrate_cable
38+
pragmas:
39+
mmap_size: <%= 16 * 1024 * 1024 %> # 16MB
3240

3341
# Warning: The database defined as "test" will be erased and
3442
# re-generated from your development database when you run "rake".
@@ -60,15 +68,23 @@ production:
6068
primary:
6169
<<: *default
6270
database: storage/production/data.sqlite3
71+
pragmas:
72+
mmap_size: <%= 128 * 1024 * 1024 %> # 128MB
6373
cache:
6474
<<: *default
6575
database: storage/production/cache.sqlite3
6676
migrations_paths: db/migrate_cache
77+
pragmas:
78+
mmap_size: <%= 64 * 1024 * 1024 %> # 64MB
6779
queue:
6880
<<: *default
6981
database: storage/production/queue.sqlite3
7082
migrations_paths: db/migrate_queue
83+
pragmas:
84+
mmap_size: <%= 64 * 1024 * 1024 %> # 64MB
7185
cable:
7286
<<: *default
7387
database: storage/production/cable.sqlite3
7488
migrations_paths: db/migrate_cable
89+
pragmas:
90+
mmap_size: <%= 16 * 1024 * 1024 %> # 16MB

0 commit comments

Comments
 (0)