Skip to content

Commit

Permalink
cache size
Browse files Browse the repository at this point in the history
  • Loading branch information
kyscott18 committed Jun 13, 2024
1 parent bfb5925 commit 337021c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/core/src/common/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,15 @@ export const buildOptions = ({ cliOptions }: { cliOptions: CliOptions }) => {
databaseHeartbeatInterval: 10 * 1000,
databaseHeartbeatTimeout: 25 * 1000,

indexingCacheBytes: os.freemem() / 3,
// os.freemem() / 4, bucketed closest to 64, 128, 256, 512, 1024, 2048 mB
indexingCacheBytes:
2 **
Math.min(
Math.max(Math.round(Math.log2(os.freemem() / 1_024 / 1_024 / 4)), 6),
11,
) *
1_024 *
1_024,

syncMaxIntervals: 50_000,
} satisfies Options;
Expand Down

0 comments on commit 337021c

Please sign in to comment.