Commit 2303d5a
add disk limit in rocksdb (disk/mem ratio)
Summary:
Introducting a disk size limit (relative memory) ```db_rocksdb_disk_mem_capacity_ratio_limit``` and changing the RocksDB impl of ```getTotalCapacity```
* ratio is optional, if not provided we use full host (as today)
* ratio defined in server_config, defined per-tier. So possible to deploy to ```glean.query``` tiers only
If we go for this solution:
* No more load balancing work needed for a mix of T3/T10
* we can set a ratio (e.g., 30 to start with) which is higher than possible ratio for a T10, so effectively a T10 will use the actual full disk space, and a T3 will be capped at 30 * RAM_capacity
* will also allow to easily change cache size programmatically with a similar config value: ```db_rocks_cache_mem_capacity_ratio```
_______
**OSS compat**
see MemoryReader in D87988951
______
**How SM loadbalancing works**
We define a resource where formula is
shard_size = counter / thresholdCounter
==>
shard_size = glean.shard.[SHARDID.LSB].disk_used_bytes / glean.db.disk.capacity_bytes
defined here
https://www.internalfb.com/code/configerator/[3227e8542f281d93b3a2b529c501e76e92463167]/source/glean/server/glean.query.cinc?lines=201-207
We log to fb303 counters here, using the **getTotalCapacity**
so we'll report a limited capacity here if ratio is set
https://www.internalfb.com/code/fbsource/[6137dfc20518d1c567e635052c344e6fd14e9c81]/fbcode/glean/db/Glean/Database/Env.hs?lines=222%2C225-226
Reviewed By: iamirzhan
Differential Revision: D88269912
fbshipit-source-id: a7acccf33f74b0eecf59645e90aba3c82dd5b19e1 parent 5df2a83 commit 2303d5a
2 files changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
419 | 420 | | |
420 | 421 | | |
421 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
| 85 | + | |
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
84 | 95 | | |
85 | 96 | | |
86 | 97 | | |
| |||
236 | 247 | | |
237 | 248 | | |
238 | 249 | | |
239 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
240 | 255 | | |
241 | 256 | | |
242 | 257 | | |
| |||
245 | 260 | | |
246 | 261 | | |
247 | 262 | | |
248 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
249 | 269 | | |
250 | 270 | | |
251 | 271 | | |
| |||
0 commit comments